Make sure users are added to the docker group. This is required to run docker commands without sudo.
Some checks failed
continuous-integration/drone/push Build is failing

Signed-off-by: Noah Knegt <git@noahknegt.com>
This commit is contained in:
2023-03-31 11:33:59 +02:00
parent 7217b373b6
commit a41d3550c5
3 changed files with 23 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
# ===================================================================================================
# ? ABOUT
# @author : Noah Knegt
# @email : personal@noahknegt.com
# @repo : https://git.noahknegt.com/noah.knegt/ansible-automations
# @createdOn : 31-03-2023
# @description : This will add selected users to the docker group.
# ===================================================================================================
---
- name: Add users to the docker group
user:
name: "{{ item }}"
groups: docker
append: yes
with_items: "{{ docker_users }}"
when: docker_users is defined

View File

@@ -16,5 +16,8 @@
- include_tasks: install.yml
when: docker_update is defined
- include_tasks: addusers.yml
when: docker_update is defined
- include_tasks: cleanup.yml
when: docker_update is defined