ansible-role-unifi-controller/molecule/default/cleanup.yml
2023-09-21 15:39:23 +02:00

28 lines
929 B
YAML

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