Cleaner docker compose detection

master
Kuba Orlik 6 days ago
parent 6bd93dfd09
commit d3f18dbccc

@ -1,12 +1,16 @@
- name: Check if peertube deployment is present
ansible.builtin.stat:
path: "{{ item }}"
loop:
- "{{ peertube_install_dir }}/compose.yaml"
- "{{ peertube_install_dir }}/env"
register: peertube_files
- name: "docker compose down" - name: "docker compose down"
community.docker.docker_compose_v2: community.docker.docker_compose_v2:
state: "absent" state: "absent"
project_src: "{{ peertube_install_dir }}" project_src: "{{ peertube_install_dir }}"
register: compose_result when: peertube_files.results | map(attribute='stat.exists') | select('equalto', false) | list | length == 0
failed_when: >
compose_result.failed and
("is not a directory" not in compose_result.msg) and
("does not contain compose.yaml" not in compose_result.msg)
- name: "Create the peertube directory" - name: "Create the peertube directory"
file: file:

Loading…
Cancel
Save