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 }}'

On Thursday, July 13, 2017 at 1:59:59 PM UTC-4, Robert Chen wrote:
>
> default user add to users group, if docker group is there, also add to 
> docker group.
>
> How to write this snabile-playbook?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/ef90eb22-37e1-45d8-9b83-16505b5c1a86%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to