Revert "Role: docker_compose: replace command with module (#214)"
This reverts commit c8e7fe9dc6
.
This commit is contained in:
parent
47b8b13139
commit
8c31964a93
1 changed files with 9 additions and 9 deletions
|
@ -51,13 +51,13 @@
|
|||
when:
|
||||
- item.network is defined
|
||||
|
||||
- name: restart changed container
|
||||
- name: (re)start container
|
||||
become: true
|
||||
community.docker.docker_compose_v2:
|
||||
project_src: "{{ compose_dest_basedir }}/{{ item.name }}"
|
||||
state: restarted
|
||||
dependencies: true
|
||||
pull: missing
|
||||
ansible.builtin.command: docker-compose up -d
|
||||
args:
|
||||
chdir: "{{ compose_dest_basedir }}/{{ item.name }}"
|
||||
register: start_result # speichere ergebnis in var
|
||||
changed_when: "start_result.rc == 0" # markiere tasks als changed when exit-code == 0
|
||||
loop: "{{ compose_files }}"
|
||||
when:
|
||||
- item.state == "present"
|
||||
|
@ -65,9 +65,9 @@
|
|||
|
||||
- name: stop old container
|
||||
become: true
|
||||
community.docker.docker_compose_v2:
|
||||
project_src: "{{ compose_dest_basedir }}/{{ item.name }}"
|
||||
state: absent
|
||||
ansible.builtin.command: docker-compose down # noqa no-changed-when
|
||||
args:
|
||||
chdir: "{{ compose_dest_basedir }}/{{ item.name }}"
|
||||
loop: "{{ compose_files }}"
|
||||
when:
|
||||
- item.state == "absent"
|
||||
|
|
Loading…
Reference in a new issue