--- # create directories - name: "create semaphore directories" ansible.builtin.file: path: "{{ item }}" owner: "1001" group: "1001" state: "directory" mode: "0775" loop: - "/mnt/semaphore" - "/mnt/semaphore/data" - "/mnt/semaphore/tmp" # run semaphore - name: "run semaphore" community.docker.docker_container: # container_default_behavior auto_remove: "no" container_default_behavior: "no_defaults" detach: "yes" init: "no" interactive: "no" log_driver: "json-file" log_options: max-size: "5m" max-file: "3" memory: "0" paused: "no" privileged: "no" pull: "always" read_only: "no" state: "started" tty: "no" # semaphore name: "semaphore-app" image: "docker.io/semaphoreui/semaphore:v2.16.31" image_name_mismatch: "recreate" restart_policy: "unless-stopped" network_mode: "host" volumes: - "/mnt/semaphore/data:/var/lib/semaphore" - "/mnt/semaphore/tmp:/tmp/semaphore" ports: - "3000:3000/tcp" env: # ansible ANSIBLE_HOST_KEY_CHECKING: "False" # semaphore SEMAPHORE_ADMIN_EMAIL: "{{ semaphore_admin_email }}" SEMAPHORE_ADMIN_NAME: "{{ semaphore_admin_name }}" SEMAPHORE_ADMIN_PASSWORD: "{{ semaphore_admin_password }}" SEMAPHORE_ADMIN: "{{ semaphore_admin_username }}" SEMAPHORE_EMAIL_SENDER: "{{ semaphore_email_sender }}" SEMAPHORE_EMAIL_USERNAME: "{{ semaphore_email_username }}" SEMAPHORE_EMAIL_HOST: "{{ semaphore_email_host }}" SEMAPHORE_EMAIL_PORT: "{{ semaphore_email_port }}" SEMAPHORE_EMAIL_PASSWORD: "{{ semaphore_email_password }}" SEMAPHORE_EMAIL_SECURE: "True" SEMAPHORE_EMAIL_TLS: "True" SEMAPHORE_DB_DIALECT: "sqlite" SEMAPHORE_RUNNER_REGISTRATION_TOKEN: "{{ semaphore_runner_token }}" SEMAPHORE_TOTP_ALLOW_RECOVERY: "True" SEMAPHORE_TOTP_ENABLED: "True" SEMAPHORE_USE_REMOTE_RUNNER: "True"