refactor: consolidate all roles into ansible/roles/ and update ansible.cfg

- Move all roles from playbooks/roles/ to roles/
- Update roles_path in ansible.cfg
- Add cast user to common role
- Create standalone podman role
- Add semaphore role with Podman + Quadlet support
This commit is contained in:
Hermes Agent service account
2026-05-26 22:22:08 -05:00
parent 9250b0f193
commit 92b2a9d609
98 changed files with 158 additions and 78 deletions

View File

@@ -0,0 +1,55 @@
# ------------------------------------------------------------------------------
# FILE: roles/traefik/tasks/main.yml
# DESCRIPTION: Deploys Traefik from boilerplate-generated files in the repo.
# The compose.yaml and dynamic config live in boilerplates/traefik/
# and are copied to the host. Only the .env file is templated
# to inject secrets from Ansible vault.
# ------------------------------------------------------------------------------
- name: Create Traefik directory structure
file:
path: "{{ item }}"
state: directory
owner: "{{ ansible_user }}"
group: docker
mode: '0775'
loop:
- "{{ traefik_base_dir }}"
- "{{ traefik_base_dir }}/dynamic"
- name: Copy compose.yaml from boilerplate
copy:
src: "{{ playbook_dir }}/../../boilerplates/traefik/compose.yaml"
dest: "{{ traefik_base_dir }}/compose.yaml"
owner: "{{ ansible_user }}"
group: docker
mode: '0644'
notify: restart traefik
- name: Copy dynamic configuration from boilerplate
copy:
src: "{{ playbook_dir }}/../../boilerplates/traefik/dynamic/"
dest: "{{ traefik_base_dir }}/dynamic/"
owner: "{{ ansible_user }}"
group: docker
mode: '0644'
notify: restart traefik
- name: Deploy .env with secrets from vault
template:
src: env.j2
dest: "{{ traefik_base_dir }}/.env"
owner: "{{ ansible_user }}"
group: docker
mode: '0600'
notify: restart traefik
- name: Create Traefik Docker network
docker_network:
name: proxy
state: present
- name: Start Traefik
community.docker.docker_compose_v2:
project_src: "{{ traefik_base_dir }}"
state: present