1
0
Fork 0
mirror of https://github.com/roles-ansible/ansible_collection_users.git synced 2024-08-16 10:29:50 +02:00
ansible_collection_users/roles/user/tasks/pubkeys.yml
L3D 6c5b794e41
Create and delete users and pubkeys
+ create users and groups
+ delete them too
+ add ssh keys
2024-02-14 03:17:00 +01:00

12 lines
355 B
YAML

---
- name: Set SSH Public Keys for Users
become: true
ansible.posix.authorized_key:
user: "{{ item.name }}"
state: 'present'
key: "{{ item.pubkeys | default() }}"
exclusive: true
loop: "{{ _l3d_users_user__merged_users }}"
loop_control:
label: "user: ['{{ item.name }}']"
when: item.state | default ('present') == 'present'