feat: set exclusive option for ssh keys
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
19a41eb843
commit
992c239b08
@ -6,7 +6,8 @@ users_default_users: []
|
||||
# groups:
|
||||
# - wheel
|
||||
# password: "secure"
|
||||
# key: "ssh-ed25519 AAAA..."
|
||||
# sshkeys:
|
||||
# - "ssh-ed25519 AAAA..."
|
||||
# shell: /bin/bash
|
||||
# @end
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user