20 lines
420 B
YAML
20 lines
420 B
YAML
|
---
|
||
|
- name: Create SSH directory
|
||
|
become: true
|
||
|
file:
|
||
|
path: /home/{{ item.name }}/.ssh
|
||
|
state: directory
|
||
|
owner: "{{ item.name }}"
|
||
|
group: "{{ item.name }}"
|
||
|
mode: 0644
|
||
|
loop: "{{ _users_local }}"
|
||
|
|
||
|
- name: Update authorized keys
|
||
|
become: true
|
||
|
authorized_key:
|
||
|
user: "{{ item.name }}"
|
||
|
key: "{{ item.sshkeys | join('\n') }}"
|
||
|
state: present
|
||
|
exclusive: true
|
||
|
loop: "{{ _users_local }}"
|