2018-05-08 19:09:24 +00:00
|
|
|
---
|
2018-05-08 19:31:12 +00:00
|
|
|
- name: "Add users"
|
2018-05-08 19:09:24 +00:00
|
|
|
user:
|
2019-11-28 09:50:26 +00:00
|
|
|
name: "{{ item.name }}"
|
|
|
|
comment: "{{ item.comment }}"
|
|
|
|
password: "{{ item.password }}"
|
2022-11-15 18:57:17 +00:00
|
|
|
groups: "{{ item.groups }}"
|
|
|
|
update_password: "always"
|
2019-11-28 09:50:26 +00:00
|
|
|
loop: "{{ users | default([]) }}"
|
2018-05-08 19:09:24 +00:00
|
|
|
|
|
|
|
- name: "Add ssh authorized_keys"
|
|
|
|
authorized_key:
|
2022-11-15 18:57:17 +00:00
|
|
|
user: "{{ item.name }}"
|
2022-11-15 19:28:34 +00:00
|
|
|
key: "{{ item.ssh_keys | join('\n') }}"
|
2022-11-15 18:57:17 +00:00
|
|
|
exclusive: true
|
|
|
|
loop: "{{ users | default([]) }}"
|
2018-06-23 12:44:00 +00:00
|
|
|
|
|
|
|
- name: "Add ssh authorized_keys to root user"
|
|
|
|
authorized_key:
|
|
|
|
user: "root"
|
2022-11-15 19:28:34 +00:00
|
|
|
key: "{{ item.ssh_keys | join('\n') }}"
|
2022-11-15 18:57:17 +00:00
|
|
|
exclusive: true
|
|
|
|
loop: "{{ users | default([]) }}"
|