2019-11-03 17:19:53 +00:00
|
|
|
---
|
|
|
|
- block:
|
|
|
|
- name: Set authorized_key for ssh users
|
|
|
|
authorized_key:
|
|
|
|
user: "{{ item.name }}"
|
2022-09-12 14:25:17 +00:00
|
|
|
key: "{{ item.sshkeys }}"
|
|
|
|
exclusive: True
|
2019-11-03 17:19:53 +00:00
|
|
|
state: present
|
2019-11-03 23:48:25 +00:00
|
|
|
loop: "{{ users_default_users }}"
|
2019-11-03 17:19:53 +00:00
|
|
|
loop_control:
|
|
|
|
label: "{{ item.name }}"
|
2022-09-12 14:25:17 +00:00
|
|
|
when: item.sshkeys is defined
|
2019-11-03 17:19:53 +00:00
|
|
|
become: True
|
|
|
|
become_user: root
|