ansible-playbooks/roles/docker/tasks/uninstall.yml

20 lines
521 B
YAML

---
- name: Uninstall docker
ansible.builtin.package:
name: docker
state: absent
- name: Prompt the user for confirmation
ansible.builtin.pause:
prompt: "[IRREVERSIBLE] Are you sure you want to delete {{ docker_projects_dir }}?"
echo: true
register: confirmation
- name: Remote projects directory
ansible.builtin.file:
path: "{{ docker_projects_dir }}"
state: absent
owner: "{{ ansible_user }}"
group: "{{ ansible_user }}"
when: confirmation.user_input | lower in ['yes', 'y']