Files
homelab/ansible/roles/semaphore/tasks/main.yml
Hermes Agent service account 80f810fb0c feat(semaphore): rewrite role with rootful Podman Quadlet + PostgreSQL
Complete rewrite of the semaphore role. Supersedes three prior
iterations whose admin-user-creation logic was unreliable across
Semaphore CLI versions.

Architecture:
  - Rootful Podman Quadlet under /etc/containers/systemd/
  - Separate PostgreSQL 16-alpine container on a user-defined
    podman network (semaphore-net)
  - Named volumes for both data stores (semaphore_data,
    semaphore_postgres_data) so container recreation is
    non-destructive
  - Pinned image tags: semaphoreui/semaphore:v2.18.5-ansible2.16.5
    and postgres:16-alpine
  - Post-deploy HTTP health check fails the playbook if Semaphore
    doesn't respond on /api/ping within ~60s

Admin user creation remains intentionally manual after first deploy;
the role README documents the exact podman exec command.

Removes the duplicate deploy_semaphore.yml and the now-unneeded
cleanup_semaphore.yml; day1_deploy_semaphore.yml is the canonical
entry point.
2026-05-29 21:34:22 -05:00

37 lines
1.2 KiB
YAML

---
# ============================================================================
# semaphore / main entrypoint
# ----------------------------------------------------------------------------
# Order matters:
# 1. Podman + Quadlet support installed and ready
# 2. Network created (containers reference it by name)
# 3. Volumes created (postgres + semaphore data)
# 4. Postgres started (Semaphore depends on it being ready)
# 5. Semaphore started (web service)
# 6. Verify reachable on listen port
# ============================================================================
- name: Install Podman and dependencies
ansible.builtin.import_tasks: podman.yml
tags: [semaphore, podman]
- name: Ensure podman network exists
ansible.builtin.import_tasks: network.yml
tags: [semaphore, network]
- name: Ensure podman volumes exist
ansible.builtin.import_tasks: volumes.yml
tags: [semaphore, volumes]
- name: Deploy PostgreSQL container
ansible.builtin.import_tasks: postgres.yml
tags: [semaphore, postgres]
- name: Deploy Semaphore container
ansible.builtin.import_tasks: semaphore.yml
tags: [semaphore]
- name: Verify Semaphore is reachable
ansible.builtin.import_tasks: verify.yml
tags: [semaphore, verify]