Refactor Update or create container
This commit is contained in:
parent
49a6a3f712
commit
ede7570e68
7 changed files with 13 additions and 76 deletions
|
@ -21,19 +21,10 @@
|
|||
- { src: 'docker-compose.yml.j2', dest: 'docker-compose.yml' }
|
||||
register: matrix_copy_templates_results
|
||||
|
||||
- name: Force update and restart container
|
||||
- name: Update and restart container
|
||||
community.docker.docker_compose:
|
||||
project_src: matrix
|
||||
state: present
|
||||
pull: true
|
||||
restarted: true
|
||||
when: matrix_copy_files_results.changed or matrix_copy_templates_results.changed
|
||||
restarted: "{{ matrix_copy_files_results.changed or matrix_copy_templates_results.changed }}"
|
||||
become: true
|
||||
|
||||
- name: Update or start container
|
||||
community.docker.docker_compose:
|
||||
project_src: matrix
|
||||
state: present
|
||||
pull: true
|
||||
when: not matrix_copy_files_results.changed and not matrix_copy_templates_results.changed
|
||||
become: true
|
Loading…
Add table
Add a link
Reference in a new issue