Adds option to make authorized_keys exclusive (default: false) #3
2 changed files with 4 additions and 2 deletions
|
@ -20,3 +20,4 @@ enable_sudo: yes
|
||||||
enable_passwordless_sudo: yes
|
enable_passwordless_sudo: yes
|
||||||
# Skip provisioning of the firewall
|
# Skip provisioning of the firewall
|
||||||
skip_firewall: no
|
skip_firewall: no
|
||||||
|
authorized_keys_are_exclusive: false # Be careful, this will delete non-Ansible-managed authorized keys from the target!
|
||||||
|
|
|
@ -44,8 +44,9 @@
|
||||||
user: "{{ item }}"
|
user: "{{ item }}"
|
||||||
state: present
|
state: present
|
||||||
key: "{{ lookup('file', 'public_keys/id_{{ item }}.pub') }}"
|
key: "{{ lookup('file', 'public_keys/id_{{ item }}.pub') }}"
|
||||||
|
exclusive: "{{ authorized_keys_are_exclusive | bool }}"
|
||||||
with_items: "{{ users }}"
|
with_items: "{{ users }}"
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
|
|
||||||
- block:
|
- block:
|
||||||
- name: 'Ensure that wheel group is existing'
|
- name: 'Ensure that wheel group is existing'
|
||||||
|
|
Loading…
Add table
Reference in a new issue