17 lines
473 B
YAML
17 lines
473 B
YAML
- name: Create user {{ item.key }}
|
|
user:
|
|
name: '{{ item.key }}'
|
|
password: '{{ item.value.default_password }}'
|
|
update_password: on_create
|
|
shell: /bin/bash
|
|
groups: '{{["sudo"] if users_enable_sudo else []}}'
|
|
|
|
- name: '{{ item.key }}: Configure ssh public keys'
|
|
authorized_key:
|
|
user: '{{ item.key }}'
|
|
key: '{{ key }}'
|
|
loop: '{{ item.value.authorized_keys }}'
|
|
loop_control:
|
|
loop_var: key
|
|
when:
|
|
item.value.authorized_keys is defined |