semaphore/tasks/install.yaml

75 lines
1.9 KiB
YAML

---
# create directories
- name: "create semaphore directories"
ansible.builtin.file:
path: "{{ item }}"
state: "directory"
mode: "0755"
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.18"
image_name_mismatch: "recreate"
restart_policy: "unless-stopped"
networks:
- name: "semaphore"
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"