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"
community.docker.docker_compose_v2:
state: "absent"
project_src: "{{ peertube_install_dir }}"
register: compose_result
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)
when: peertube_files.results | map(attribute='stat.exists') | select('equalto', false) | list | length == 0
- name: "Create the peertube directory"
file:

Loading…
Cancel
Save