1
0
Fork 0
myserver-configuration/roles/watchtower/tasks/base.yml

22 lines
575 B
YAML

---
- name: Check watchtower directory exist
ansible.builtin.file:
path: watchtower
state: directory
- name: Copy template conf
ansible.builtin.template:
src: "{{ item.src }}"
dest: "watchtower/{{ item.dest }}"
loop:
- { src: 'docker-compose.yml.j2', dest: 'docker-compose.yml' }
register: watchtower_copy_templates_results
- name: Force update and restart container
community.docker.docker_compose:
project_src: watchtower
state: present
pull: true
restarted: "{{ watchtower_copy_templates_results.changed }}"
become: true