24 lines
592 B
YAML
24 lines
592 B
YAML
---
|
|
- name: "Add users"
|
|
user:
|
|
name: "{{ item.name }}"
|
|
comment: "{{ item.comment }}"
|
|
password: "{{ item.password }}"
|
|
groups: "{{ item.groups }}"
|
|
update_password: "always"
|
|
loop: "{{ users | default([]) }}"
|
|
|
|
- name: "Add ssh authorized_keys"
|
|
authorized_key:
|
|
user: "{{ item.name }}"
|
|
key: "{{ item.ssh_keys | join('\n') }}"
|
|
exclusive: true
|
|
loop: "{{ users | default([]) }}"
|
|
|
|
- name: "Add ssh authorized_keys to root user"
|
|
authorized_key:
|
|
user: "root"
|
|
key: "{{ item.ssh_keys | join('\n') }}"
|
|
exclusive: true
|
|
loop: "{{ users | default([]) }}"
|