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:
|
|
|
|
name: "{{ item.key }}"
|
|
|
|
comment: "{{ item.value.comment }}"
|
2018-05-08 19:31:12 +00:00
|
|
|
password: "{{ item.value.password }}"
|
2018-05-08 19:09:24 +00:00
|
|
|
update_password: "on_create"
|
2018-05-08 19:31:12 +00:00
|
|
|
groups: "{{ item.value.groups }}"
|
2018-05-08 19:09:24 +00:00
|
|
|
with_dict: "{{ users | default({}) }}"
|
|
|
|
|
|
|
|
- name: "Add ssh authorized_keys"
|
|
|
|
authorized_key:
|
|
|
|
user: "{{ item.key }}"
|
|
|
|
key: "{{ item.value.key }}"
|
|
|
|
with_dict: "{{ users | default({}) }}"
|
2018-06-23 12:44:00 +00:00
|
|
|
|
|
|
|
- name: "Add ssh authorized_keys to root user"
|
|
|
|
authorized_key:
|
|
|
|
user: "root"
|
|
|
|
key: "{{ item.value.key }}"
|
|
|
|
with_dict: "{{ users | default({}) }}"
|