diff --git a/tasks/main.yml b/tasks/main.yml index 07c17d3..2d7b38f 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -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: