2022-09-19 23:13:01 +02:00
|
|
|
---
|
|
|
|
- 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"
|
2022-09-19 23:13:01 +02:00
|
|
|
register: docker_compose_file
|
2022-09-22 10:12:52 +02:00
|
|
|
|
|
|
|
- name: Remove docker-compose.
|
2022-09-19 23:13:01 +02:00
|
|
|
community.docker.docker_compose:
|
2022-09-22 10:12:52 +02:00
|
|
|
project_src: ~/plausible/
|
2022-09-19 23:13:01 +02:00
|
|
|
build: false
|
|
|
|
state: absent
|
|
|
|
when: docker_compose_file.stat.exists
|
|
|
|
become: false
|
2022-09-22 10:12:52 +02:00
|
|
|
|
2022-09-19 23:13:01 +02:00
|
|
|
- name: Remove the docker-compose file
|
|
|
|
ansible.builtin.file:
|
2022-09-22 10:12:52 +02:00
|
|
|
path: "~/plausible/docker-compose.yml"
|
2022-09-19 23:13:01 +02:00
|
|
|
state: absent
|
2022-09-22 10:12:52 +02:00
|
|
|
when: docker_compose_file.stat.exists
|