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

22 lines
No EOL
547 B
YAML

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