1
0
Fork 0
home-stack-ansible/roles/common/tasks/user.yml

17 lines
434 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
- 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