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

23 lines
575 B
YAML
Raw Normal View History

2023-09-23 11:00:21 +02:00
---
- 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