refactor: switch deployment from command to community.docker.docker_compose_v2
This commit is contained in:
parent
e1f3a22a23
commit
f9d590170d
@ -23,13 +23,12 @@
|
|||||||
when: item.state == "file"
|
when: item.state == "file"
|
||||||
|
|
||||||
- name: Deploy docker-compose for {{ current_stack_name }}
|
- name: Deploy docker-compose for {{ current_stack_name }}
|
||||||
command: docker compose -f "{{ current_stack_dest }}/docker-compose.yml" up -d --pull always --remove-orphans
|
community.docker.docker_compose_v2:
|
||||||
|
project_src: "{{ current_stack_dest }}"
|
||||||
|
state: present
|
||||||
|
pull: always
|
||||||
|
remove_orphans: yes
|
||||||
register: docker_compose_output
|
register: docker_compose_output
|
||||||
# Not perfect idempotency, but the built-in docker_compose module doesn't support docker-compose v2
|
|
||||||
# And of course there's an IPv6 bug in docker-compose v1, smh
|
|
||||||
# https://github.com/docker/compose/issues/7670
|
|
||||||
changed_when: "'created' in docker_compose_output.stderr.lower()"
|
|
||||||
failed_when: docker_compose_output.rc != 0
|
|
||||||
|
|
||||||
- debug:
|
- debug:
|
||||||
var: docker_compose_output
|
var: docker_compose_output
|
||||||
|
Loading…
x
Reference in New Issue
Block a user