mirror of
https://github.com/geerlingguy/ansible-role-docker.git
synced 2024-11-18 19:10:43 +01:00
Add user to docker group functionality
This commit is contained in:
parent
2b507a374e
commit
2bf1b29d3f
@ -36,6 +36,12 @@ Docker Compose installation options.
|
||||
|
||||
(Used only for RedHat/CentOS.) You can enable the Edge or Test repo by setting the respective vars to `1`.
|
||||
|
||||
Set the docker_users variable to allow those users to run docker (these users are added to the docker group)
|
||||
|
||||
docker_users:
|
||||
- Guy
|
||||
- James
|
||||
|
||||
## Use with Ansible (and `docker` Python library)
|
||||
|
||||
Many users of this role wish to also use Ansible to then _build_ Docker images and manage Docker containers on the server where Docker is installed. In this case, you can easily add in the `docker` Python library using the `geerlingguy.pip` role:
|
||||
|
@ -17,3 +17,6 @@ docker_apt_repository: "deb https://download.docker.com/linux/{{ ansible_distrib
|
||||
docker_yum_repo_url: https://download.docker.com/linux/centos/docker-{{ docker_edition }}.repo
|
||||
docker_yum_repo_enable_edge: 0
|
||||
docker_yum_repo_enable_test: 0
|
||||
|
||||
# Docker users
|
||||
docker_users: []
|
||||
|
6
tasks/docker-users.yml
Normal file
6
tasks/docker-users.yml
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
- name: Add users to docker group
|
||||
user:
|
||||
name: "{{ item }}"
|
||||
group: docker
|
||||
with_items: "{{ docker_users }}"
|
Loading…
Reference in New Issue
Block a user