ansible-role-plausible/molecule/default/cleanup.yml

24 lines
635 B
YAML
Raw Permalink Normal View History

---
- name: Clean up
hosts: all
gather_facts: true
tasks:
- name: Check if the docker-compose file exists.
ansible.builtin.stat:
2022-09-22 10:12:52 +02:00
path: "~/plausible/docker-compose.yml"
register: docker_compose_file
2022-09-22 10:12:52 +02:00
- name: Remove docker-compose.
community.docker.docker_compose:
2022-09-22 10:12:52 +02:00
project_src: ~/plausible/
build: false
state: absent
when: docker_compose_file.stat.exists
become: false
2022-09-22 10:12:52 +02:00
- name: Remove the docker-compose file
ansible.builtin.file:
2022-09-22 10:12:52 +02:00
path: "~/plausible/docker-compose.yml"
state: absent
2022-09-22 10:12:52 +02:00
when: docker_compose_file.stat.exists