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

24 lines
620 B
YAML
Raw Permalink Normal View History

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