role-traefik/tasks/main.yml

54 lines
1.1 KiB
YAML

---
- name: Create podman folder
file:
path: /etc/containers/systemd
state: directory
mode: 0775
recurse: yes
- name: Create letsencrypt folder
file:
path: /letsencrypt
state: directory
mode: 0775
recurse: yes
- name: Create letsencrypt folder
file:
path: /etc/traefik
state: directory
mode: 0775
recurse: yes
- name: Setup Podman quadlet
block:
- name: Copy traefik.network
ansible.builtin.template:
src: traefik.network
dest: "/etc/containers/systemd/traefik.network"
- name: Copy traefik.container
ansible.builtin.template:
src: traefik.quadlet.j2
dest: "/etc/containers/systemd/traefik.container"
- name: Copy traefik.yml
ansible.builtin.template:
src: traefik.yaml.j2
dest: "/etc/traefik/traefik.yaml"
- name: "Reload systemd"
ansible.builtin.systemd:
daemon_reload: true
when: ansible_service_mgr == "systemd"
- name: Start Traefik
systemd_service:
enabled: true
name: traefik
state: started
notify:
- Restart traefik