Files
homelab/ansible/roles/semaphore/tasks/verify.yml
Hermes Agent service account d05cfcf317 fix(semaphore): provide SEMAPHORE_ADMIN_* env vars for non-interactive first boot
The v2.18 image's entrypoint runs the setup wizard on first boot. Without
the SEMAPHORE_ADMIN_* variables it prompts on stdin, fails with 'Username
cannot be empty', and the container exits — leading to a crash loop.

Set:
  SEMAPHORE_ADMIN=admin
  SEMAPHORE_ADMIN_NAME=Administrator
  SEMAPHORE_ADMIN_EMAIL=admin@local.mk-labs.cloud
  SEMAPHORE_ADMIN_PASSWORD={{ vault_semaphore_admin_password }}
  SEMAPHORE_PLAYBOOK_PATH=/var/lib/semaphore/playbooks

The env-var bootstrap path is stable in v2.x; only the legacy
'semaphore user add' CLI invocation was unreliable. Drop the manual
user-add step from the README.
2026-05-29 21:38:44 -05:00

27 lines
1.1 KiB
YAML

---
# ============================================================================
# Post-deploy verification
# ----------------------------------------------------------------------------
# Polls the local Semaphore port until it responds. Fails loudly if the
# service doesn't come up — the operator should not get an "all green"
# playbook result while Semaphore is silently broken.
# ============================================================================
- name: Wait for Semaphore HTTP endpoint
ansible.builtin.uri:
url: "http://127.0.0.1:{{ semaphore_listen_port }}/api/ping"
status_code: [200, 201, 204]
return_content: false
register: semaphore_ping
until: semaphore_ping.status in [200, 201, 204]
retries: "{{ semaphore_health_check_retries }}"
delay: "{{ semaphore_health_check_delay }}"
- name: Report Semaphore status
ansible.builtin.debug:
msg: >-
Semaphore is reachable on http://127.0.0.1:{{ semaphore_listen_port }}.
Public URL: {{ semaphore_web_url }}.
Admin user 'admin' is provisioned automatically on first boot using
vault_semaphore_admin_password.