# {{ ansible_managed }} # mk-labs PostgreSQL backing store for SemaphoreUI # Managed by Ansible - semaphore role [Unit] Description=PostgreSQL for SemaphoreUI After=network-online.target Wants=network-online.target [Container] Image={{ semaphore_postgres_image }} ContainerName={{ semaphore_postgres_container_name }} Network={{ semaphore_network_name }} # Persistent data on a named volume. :Z relabels for SELinux; :U maps # ownership for rootless. Rootful + ext4 doesn't strictly require either, # but keeping them is harmless and portable. Volume={{ semaphore_postgres_volume }}:/var/lib/postgresql/data:Z Environment=POSTGRES_USER={{ semaphore_db_user }} Environment=POSTGRES_DB={{ semaphore_db_name }} Environment=POSTGRES_PASSWORD={{ semaphore_db_password }} # Initialise the locale and encoding deterministically Environment=POSTGRES_INITDB_ARGS=--encoding=UTF8 --locale=C # Healthcheck — systemd doesn't act on this, but it's useful diagnostically HealthCmd=pg_isready -U {{ semaphore_db_user }} -d {{ semaphore_db_name }} HealthInterval=10s HealthTimeout=5s HealthRetries=3 [Service] Restart=always TimeoutStartSec=120 [Install] WantedBy=multi-user.target default.target