ansible-role-mealie/molecule/default/cleanup.yml
2023-01-09 15:42:53 +01:00

23 lines
744 B
YAML

---
- name: Clean up
hosts: all
gather_facts: true
tasks:
- name: Check if the docker-compose file exists.
ansible.builtin.stat:
path: "{{ mealie_config_path | expanduser | realpath }}/docker-compose.yml"
register: docker_compose_file
- name: Remove docker-compose.
community.docker.docker_compose:
project_src: "{{ mealie_config_path | expanduser | realpath }}/"
build: false
state: absent
when: docker_compose_file.stat.exists
become: false
- name: Remove the docker-compose file
ansible.builtin.file:
path: "{{ mealie_config_path | expanduser | realpath }}/docker-compose.yml"
state: absent
when: docker_compose_file.stat.exists