15 lines
346 B
YAML
15 lines
346 B
YAML
- name: Create user {{ user.name }}
|
|
user:
|
|
name: "{{ user.name }}"
|
|
shell: /bin/bash
|
|
groups: "{{ user.group }},ssh_access"
|
|
password: "{{ user.pwhash }}"
|
|
|
|
- name: Add user to sudoers
|
|
lineinfile:
|
|
path: "/etc/sudoers.d/{{ user.name }}"
|
|
create: yes
|
|
line: "{{ user.name }} ALL=(ALL) NOPASSWD: ALL"
|
|
when: user.sudoers
|
|
|