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

30 lines
733 B
YAML

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