b9be45dc71
Complete IaC covering: - 14 roles: common, docker, traefik, vaultwarden, monitoring, media, matrix, home_assistant, frigate, adguard, gitea, semaphore, openclaw, security, backup - Inventory for all hosts (Peggy, Bart, Yoda, NAS, Firewalla) - Stack playbooks: core-infrastructure, monitoring, media, communication, automation, smarthome, security-hardening - Maintenance playbooks: update-containers, backup, health-check - Production Docker Compose templates with Traefik labels - Security hardening (sysctl, auditd, UFW, fail2ban) - Automated backups with retention policy
42 lines
1007 B
YAML
42 lines
1007 B
YAML
---
|
|
- name: Create Traefik directories
|
|
ansible.builtin.file:
|
|
path: "{{ item }}"
|
|
state: directory
|
|
owner: glyptic
|
|
group: docker
|
|
mode: "0755"
|
|
loop:
|
|
- "{{ traefik_compose_dir }}"
|
|
- "{{ traefik_data_dir }}"
|
|
- "{{ traefik_data_dir }}/acme"
|
|
- "{{ traefik_data_dir }}/dynamic"
|
|
tags: [traefik]
|
|
|
|
- name: Ensure acme.json exists with correct permissions
|
|
ansible.builtin.file:
|
|
path: "{{ traefik_data_dir }}/acme/acme.json"
|
|
state: touch
|
|
owner: root
|
|
group: root
|
|
mode: "0600"
|
|
modification_time: preserve
|
|
access_time: preserve
|
|
tags: [traefik]
|
|
|
|
- name: Deploy Traefik compose file
|
|
ansible.builtin.template:
|
|
src: docker-compose.yml.j2
|
|
dest: "{{ traefik_compose_dir }}/docker-compose.yml"
|
|
owner: glyptic
|
|
group: docker
|
|
mode: "0644"
|
|
notify: Restart traefik stack
|
|
tags: [traefik]
|
|
|
|
- name: Start Traefik stack
|
|
community.docker.docker_compose_v2:
|
|
project_src: "{{ traefik_compose_dir }}"
|
|
state: present
|
|
tags: [traefik]
|