mirror of
https://github.com/geerlingguy/ansible-role-docker.git
synced 2024-11-18 19:10:43 +01:00
commit
db8265990b
@ -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:
|
||||
|
@ -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: []
|
||||
|
7
tasks/docker-users.yml
Normal file
7
tasks/docker-users.yml
Normal 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 }}"
|
@ -23,3 +23,6 @@
|
||||
|
||||
- include_tasks: docker-compose.yml
|
||||
when: docker_install_compose
|
||||
|
||||
- include: docker-users.yml
|
||||
when: docker_users
|
||||
|
Loading…
Reference in New Issue
Block a user