24 lines
No EOL
685 B
YAML
24 lines
No EOL
685 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' }
|
|
- { src: 'config/dynamic_conf.yml', dest: 'config/dynamic_conf.yml' }
|
|
register: traefik_copy_templates_results
|
|
|
|
- name: Update and restart container
|
|
community.docker.docker_compose:
|
|
project_src: traefik
|
|
state: present
|
|
pull: true
|
|
restarted: "{{ traefik_copy_templates_results.changed }}"
|
|
become: true |