This repository has been archived on 2024-05-02. You can view files and clone it, but cannot push or open issues or pull requests.
omni-ansible/tasks/deploy-ssh-keys.yml

20 lines
420 B
YAML
Raw Normal View History

---
- 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 }}"