Update sshkey deployment to work with new variable system

This commit is contained in:
2020-03-17 22:49:34 -04:00
parent 182cdb20ae
commit 6544f30114
2 changed files with 31 additions and 12 deletions

19
tasks/deploy-ssh-keys.yml Normal file
View File

@@ -0,0 +1,19 @@
---
- 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 }}"