29 lines
No EOL
802 B
YAML
29 lines
No EOL
802 B
YAML
---
|
|
|
|
- name: Check traefik directory exist
|
|
ansible.builtin.file:
|
|
path: traefik
|
|
state: directory
|
|
|
|
- name: Copy template conf
|
|
ansible.builtin.template:
|
|
src: "{{ item.src }}"
|
|
dest: "traefik/{{ item.dest }}"
|
|
loop:
|
|
- { src: 'docker-compose.yml', dest: 'docker-compose.yml' }
|
|
- { src: 'config/traefik.yml', dest: 'config/traefik.yml' }
|
|
register: traefik_copy_templates_results
|
|
|
|
# Avoid restart docker if dynamic_conf updated
|
|
- name: Copy dynamic_conf conf
|
|
ansible.builtin.template:
|
|
src: "config/dynamic_conf.yml"
|
|
dest: "traefik/config/dynamic_conf.yml"
|
|
|
|
- name: Update and restart container
|
|
community.docker.docker_compose_v2:
|
|
project_src: traefik
|
|
state: present
|
|
pull: always
|
|
restarted: "{{ traefik_copy_templates_results.changed }}"
|
|
become: true |