Skip to content

fix(docker): update uninstall option #55

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions roles/docker/meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ argument_specs:
required: false
description: The home directory for the rootless user.

docker_uninstall:
type: bool
required: false
description: Uninstall Docker packages.
docker_state:
type: str
default: present
description: The state of the Docker installation.
choices:
- present
- absent
4 changes: 2 additions & 2 deletions roles/docker/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
- ansible_os_family == 'Debian'

- name: Uninstall Docker packages
when: docker_uninstall
when: docker_state == 'absent'
ansible.builtin.import_role:
name: deadnews.util.docker
tasks_from: uninstall

- name: Install Docker
when: not docker_uninstall
when: docker_state == 'present'
block:
- name: Install Docker
ansible.builtin.import_role:
Expand Down
2 changes: 1 addition & 1 deletion roles/docker/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ docker_rootless_uid: 800
docker_rootless_user_home: /var/lib/{{ docker_rootless_user }}
docker_rootless_user: rootless
docker_rootless: false
docker_uninstall: false
docker_state: present