Revert "Role: docker_compose: replace command with module (#214)"
All checks were successful
ansible-lint / gitleaks (pull_request) Successful in 12s
ansible-lint / Ansible Lint (pull_request) Successful in 1m0s

This reverts commit c8e7fe9dc6.
This commit is contained in:
Michael Grote 2024-11-15 20:29:06 +00:00
parent 47b8b13139
commit 8c31964a93

View file

@ -51,13 +51,13 @@
when: when:
- item.network is defined - item.network is defined
- name: restart changed container - name: (re)start container
become: true become: true
community.docker.docker_compose_v2: ansible.builtin.command: docker-compose up -d
project_src: "{{ compose_dest_basedir }}/{{ item.name }}" args:
state: restarted chdir: "{{ compose_dest_basedir }}/{{ item.name }}"
dependencies: true register: start_result # speichere ergebnis in var
pull: missing changed_when: "start_result.rc == 0" # markiere tasks als changed when exit-code == 0
loop: "{{ compose_files }}" loop: "{{ compose_files }}"
when: when:
- item.state == "present" - item.state == "present"
@ -65,9 +65,9 @@
- name: stop old container - name: stop old container
become: true become: true
community.docker.docker_compose_v2: ansible.builtin.command: docker-compose down # noqa no-changed-when
project_src: "{{ compose_dest_basedir }}/{{ item.name }}" args:
state: absent chdir: "{{ compose_dest_basedir }}/{{ item.name }}"
loop: "{{ compose_files }}" loop: "{{ compose_files }}"
when: when:
- item.state == "absent" - item.state == "absent"