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
Michiel W. Beijen 0e2b1a0ad4 Rename user.exklusive_pubkeys to exclusive_pubkeys
For backwards compatibility, the variable name user.exklusive_pubkeys
if present in configuration can still be used.
2024-05-23 12:42:23 +02:00

13 lines
431 B
YAML

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