Fix role.state:absent

This commit is contained in:
Tobias Manske 2023-02-28 20:17:23 +01:00
parent a426b4a2e5
commit 0e63672dec
Signed by: tobias
GPG Key ID: E83C743C1FC2F79A

View File

@ -1,11 +1,18 @@
--- ---
- name: Check if service is present
stat:
path: "{{ service_dir | mandatory }}"
register: dir
- name: Stop Service - name: Stop Service
community.docker.docker_compose: community.docker.docker_compose:
project_src: "{{ service_dir | mandatory }}" project_src: "{{ service_dir | mandatory }}"
state: absent state: absent
remove_orphans: true remove_orphans: true
when: dir.stat.exists == True
- name: Remove Service - name: Remove Service
file: file:
state: absent state: absent
path: "{{ service_dir | mandatory }}" path: "{{ service_dir | mandatory }}"
when: dir.stat.exists == True