Files
ansible.role.users/tasks/main.yml
T
2019-01-21 18:51:25 +08:00

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