feat: set exclusive option for ssh keys
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Robert Kaussow 2022-09-12 16:25:17 +02:00
parent 19a41eb843
commit 992c239b08
Signed by: xoxys
GPG Key ID: 4E692A2EAECC03C0
2 changed files with 5 additions and 3 deletions

View File

@ -6,7 +6,8 @@ users_default_users: []
# groups:
# - wheel
# password: "secure"
# key: "ssh-ed25519 AAAA..."
# sshkeys:
# - "ssh-ed25519 AAAA..."
# shell: /bin/bash
# @end

View File

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