Remove redundant group management for Docker users

- Minor formatting updated
This commit is contained in:
Kris Lamoureux 2025-01-19 17:48:45 -05:00
parent 56c3721a5e
commit bd8eca0466
Signed by: kris
GPG Key ID: 105B748C1362EB96

View File

@ -24,15 +24,21 @@
- name: Install/uninstall Docker from Debian repositories - name: Install/uninstall Docker from Debian repositories
ansible.builtin.apt: ansible.builtin.apt:
name: ['docker.io', 'docker-compose', 'containerd', 'runc'] name: ["docker.io", "docker-compose", "containerd", "runc"]
state: "{{ 'absent' if docker_official else 'present' }}" state: "{{ 'absent' if docker_official else 'present' }}"
autoremove: true autoremove: true
update_cache: true update_cache: true
- name: Install/uninstall Docker from Docker repositories - name: Install/uninstall Docker from Docker repositories
ansible.builtin.apt: ansible.builtin.apt:
name: ['docker-ce', 'docker-ce-cli', 'containerd.io', name:
'docker-buildx-plugin', 'docker-compose-plugin'] [
"docker-ce",
"docker-ce-cli",
"containerd.io",
"docker-buildx-plugin",
"docker-compose-plugin",
]
state: "{{ 'present' if docker_official else 'absent' }}" state: "{{ 'present' if docker_official else 'absent' }}"
autoremove: true autoremove: true
update_cache: true update_cache: true
@ -135,14 +141,6 @@
label: "{{ item.name }}" label: "{{ item.name }}"
when: docker_compose_deploy is defined and item.env is defined when: docker_compose_deploy is defined and item.env is defined
- name: Add users to docker group
ansible.builtin.user:
name: "{{ item }}"
groups: docker
append: true
loop: "{{ docker_users }}"
when: docker_users is defined
- name: Start Docker and enable on boot - name: Start Docker and enable on boot
ansible.builtin.service: ansible.builtin.service:
name: docker name: docker