Files
Defame1297andClaude Sonnet 5.5 aad59fc339
Build / build (pull_request) Failing after 22s
Lint / lint (pull_request) Successful in 15s
Molecule / molecule (pull_request) Successful in 2m18s
feat(docker): add the docker role (#522)
Extracted from the environment repository, wave 1. Scrubbed of private
references: namespace mortis, no repository paths or issue numbers in
comments and docs, the removed docker_ufw_rules guard dropped, the molecule
scenario uses the FQCN and no provisioner environment overrides.
ansible-lint mocks the role's FQCN because CI checks the Collection out
outside an ansible_collections path.

Verified: the commit hooks. Not verified: the molecule scenario (CI only).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
2026-11-08 18:59:26 +00:00

40 lines
1.0 KiB
YAML

---
# Run with docker_remove=true (and docker_remove_data=true to purge) on a host that is safe to change.
- name: Stop and disable Docker service
become: true
ansible.builtin.systemd:
name: "{{ docker_service }}"
state: stopped
enabled: false
tags: [docker, remove]
- name: Remove Docker Engine packages
become: true
ansible.builtin.apt:
name: "{{ docker_packages }}"
state: absent
purge: "{{ docker_remove_data | default(false) | bool }}"
tags: [docker, remove]
- name: Remove Docker APT source list
become: true
ansible.builtin.file:
path: "{{ docker_apt_list_path }}"
state: absent
tags: [docker, remove]
- name: Remove Docker APT keyring
become: true
ansible.builtin.file:
path: "{{ docker_keyring_path }}"
state: absent
tags: [docker, remove]
- name: Remove Docker data directory (images, containers, volumes)
become: true
ansible.builtin.file:
path: /var/lib/docker
state: absent
when: docker_remove_data | default(false) | bool
tags: [docker, remove]