Skip to content

Commit

Permalink
fix(docker): update uninstall option (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
DeadNews authored Sep 12, 2024
1 parent a7b2b34 commit 2b55775
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
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

0 comments on commit 2b55775

Please sign in to comment.