xoxys.users/tasks/users_keys.yml

15 lines
357 B
YAML

---
- block:
- name: Set authorized_key for ssh users
authorized_key:
user: "{{ item.name }}"
key: "{{ item.sshkeys }}"
exclusive: True
state: present
loop: "{{ users_default_users }}"
loop_control:
label: "{{ item.name }}"
when: item.sshkeys is defined
become: True
become_user: root