Fix restart

This commit is contained in:
SebClem 2024-04-30 11:10:28 +02:00
parent fbfd0f544e
commit d9d497d9d7
Signed by: sebclem
GPG Key ID: 5A4308F6A359EA50

View File

@ -41,12 +41,21 @@
remove_orphans: true
pull: always
build: always
state: "{{ 'restarted' if item.changed else docker_compose_state }}"
state: "{{ docker_compose_state }}"
loop: "{{ copy_result.results }}"
when: not item.failed
register: result
changed_when: "'Started' in result.stderr"
# - name: Force restart
# community.docker.docker_compose_v2:
# project_src: "{{ docker_compose_remote_project_dir + '/' + item.item.item.name }}"
# remove_orphans: true
# pull: always
# build: always
# state: "restarted"
# loop: "{{ result.results }}"
# when: not item.changed and (copy_result.results | selectattr('item.name', 'eq', item.item.item.name) | map(attribute='changed'))
- name: Prune docker
community.docker.docker_prune: