16 lines
356 B
YAML
16 lines
356 B
YAML
---
|
|
- name: Setup user for docker usage
|
|
block:
|
|
- name: Check if user exists
|
|
getent:
|
|
database: passwd
|
|
key: "{{ user.username }}"
|
|
register: user_exists
|
|
ignore_errors: true
|
|
|
|
- name: Add user to docker group
|
|
user:
|
|
name: "{{ item.username }}"
|
|
group: docker
|
|
when: user_exists is not failed
|