feat: simplify semaphore and add ssh config

This commit is contained in:
Simon Cornet 2025-10-02 14:14:26 +02:00
commit 679f31d7ae
4 changed files with 35 additions and 13 deletions

View file

@ -11,3 +11,15 @@ semaphore_email_host: "smtp"
semaphore_email_port: "465"
semaphore_email_username: "smtp-user"
semaphore_email_password: "smtp-pass"
# semaphore ansible ssh key
semaphore_ansible_ssh_key: "supersecure"
# semaphore ssh config
semaphore_ssh_config: |
host *
user ansible
identityfile /home/semaphore/.ssh/ansible.key
addressfamily inet
stricthostkeychecking no
userknownhostsfile /dev/null

View file

@ -11,8 +11,27 @@
loop:
- "/mnt/semaphore"
- "/mnt/semaphore/data"
- "/mnt/semaphore/ssh"
- "/mnt/semaphore/tmp"
# semaphore ssh config
- name: "ssh config"
ansible.builtin.template:
src: "templates/semaphore/config.j2"
dest: "/mnt/semaphore/ssh/config"
owner: "1001"
group: "1001"
mode: "0640"
# semaphore ansible ssh key
- name: "ansible ssh config"
ansible.builtin.template:
src: "templates/semaphore/ansible.key.j2"
dest: "/mnt/semaphore/ssh/ansible.key"
owner: "1001"
group: "1001"
mode: "0400"
# run semaphore
- name: "run semaphore"
community.docker.docker_container:
@ -43,6 +62,8 @@
network_mode: "host"
volumes:
- "/mnt/semaphore/ssh/config:/home/semaphore/.ssh/config"
- "/mnt/semaphore/ssh/ansible.key:/home/semaphore/.ssh/ansible.key"
- "/mnt/semaphore/data:/var/lib/semaphore"
- "/mnt/semaphore/tmp:/tmp/semaphore"
@ -51,23 +72,10 @@
env:
# ansible
ANSIBLE_HOST_KEY_CHECKING: "False"
# semaphore
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"
SEMAPHORE_SCHEDULE_TIMEZONE: "Europe/Amsterdam"
# global

View file

@ -0,0 +1 @@
{{ semaphore_ansible_ssh_key }}

View file

@ -0,0 +1 @@
{{ semaphore_ssh_config }}