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
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: Noah Knegt <git@noahknegt.com>
This commit is contained in:
17
roles/docker/tasks/addusers.yml
Normal file
17
roles/docker/tasks/addusers.yml
Normal 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
|
@@ -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
|
||||
|
Reference in New Issue
Block a user