Merge pull request #26 from jamesla/master

Add a docker_users variable
master
Jeff Geerling 2018-05-06 17:45:53 -05:00 committed by GitHub
commit db8265990b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 0 deletions

View File

@ -42,6 +42,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`.
docker_users:
- user1
- user2
Set the docker_users variable to allow those users to run docker (these users are added to the docker group)
## 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:

View File

@ -20,3 +20,6 @@ docker_apt_ignore_key_error: True
docker_yum_repo_url: https://download.docker.com/linux/{{ (ansible_distribution == "Fedora") | ternary("fedora","centos") }}/docker-{{ docker_edition }}.repo
docker_yum_repo_enable_edge: 0
docker_yum_repo_enable_test: 0
# A list of users who will be added to the docker group.
docker_users: []

View File

@ -0,0 +1,7 @@
---
- name: Ensure docker users are added to the docker group.
user:
name: "{{ item }}"
group: docker
append: yes
with_items: "{{ docker_users }}"

View File

@ -23,3 +23,6 @@
- include_tasks: docker-compose.yml
when: docker_install_compose
- include: docker-users.yml
when: docker_users