ansible/roles/traefik/tasks/main.yml

48 lines
1.1 KiB
YAML
Raw Normal View History

2021-04-24 18:15:48 +02:00
---
- name: Create Traefik directory
file:
path: "{{ traefik_folder_name }}"
state: directory
owner: "{{ base_user_name }}"
group: "{{ base_user_name }}"
mode: 0755
- name: Create certs directory
file:
path: "{{ traefik_certs_directory }}"
state: directory
owner: "root"
group: "root"
mode: 0600
- name: Create certs file
file:
path: "{{ traefik_certs_directory }}/acme.json"
state: touch
modification_time: preserve
access_time: preserve
owner: "root"
group: "root"
mode: 0600
- name: Copy Traefik files
template:
src: "{{ item }}"
# Remove .j2 extension
dest: "{{ traefik_folder_name }}/{{ (item | splitext)[0] }}"
owner: "{{ base_user_name }}"
group: "{{ base_user_name }}"
mode: 0644
loop:
- docker-compose.yml.j2
- traefik.toml.j2
- traefik_dynamic.toml.j2
- name: Ensure container is up to date
community.docker.docker_compose:
project_src: "{{ traefik_folder_name }}"
remove_orphans: yes
pull: yes
2021-04-26 21:23:23 +02:00
recreate: smart
state: present