Groups
Groups
Sign in
Groups
Groups
Ansible Project
Conversations
About
Send feedback
Help
how to add a user to docker group if docker group is there?
4,339 views
Skip to first unread message
Robert Chen
unread,
Jul 13, 2017, 1:59:59 PM
7/13/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ansible Project
default user add to users group, if docker group is there, also add to docker group.
How to write this snabile-playbook?
Larry Smith
unread,
Jul 14, 2017, 12:48:31 AM
7/14/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ansible Project
This may be of some help for you.
https://github.com/mrlesmithjr/ansible-docker/blob/master/tasks/users.yml
Basically this should work for you as a playbook.
---
- hosts: docker_hosts
vars:
docker_users:
- 'vagrant'
tasks:
- name: users | adding docker users (for use without sudo)
user:
name: "{{ item }}"
append: yes
groups: docker
become: true
with_items: '{{ docker_users }}'
Reply all
Reply to author
Forward
0 new messages