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 }}"
|
2018-05-08 19:09:24 +00:00
|
|
|
update_password: "on_create"
|
2019-11-28 09:50:26 +00:00
|
|
|
groups: "{{ item.groups }}"
|
|
|
|
loop: "{{ users | default([]) }}"
|
2018-05-08 19:09:24 +00:00
|
|
|
|
|
|
|
- name: "Add ssh authorized_keys"
|
|
|
|
authorized_key:
|
2019-11-28 09:50:26 +00:00
|
|
|
user: "{{ item.0.name }}"
|
|
|
|
key: "{{ item.1 }}"
|
|
|
|
with_subelements:
|
|
|
|
- "{{ users | default([]) }}"
|
|
|
|
- keys
|
2018-06-23 12:44:00 +00:00
|
|
|
|
|
|
|
- name: "Add ssh authorized_keys to root user"
|
|
|
|
authorized_key:
|
|
|
|
user: "root"
|
2019-11-28 09:50:26 +00:00
|
|
|
key: "{{ item.1 }}"
|
|
|
|
with_subelements:
|
|
|
|
- "{{ users | default([]) }}"
|
|
|
|
- keys
|