diff --git a/defaults/main.yml b/defaults/main.yml index 108c3d8..395c009 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -11,4 +11,5 @@ users: - vagrant sudoers: - vagrant -ensure_ansible_version: 2.10.3 \ No newline at end of file +ensure_ansible_version: 2.10.3 +authorized_keys_are_exclusive: false # Be careful, this will delete non-Ansible-managed authorized keys from the target! \ No newline at end of file diff --git a/tasks/users.yml b/tasks/users.yml index 5c38204..f3a88b9 100644 --- a/tasks/users.yml +++ b/tasks/users.yml @@ -35,8 +35,9 @@ user: "{{ item }}" state: present key: "{{ lookup('file', 'public_keys/id_{{ item }}.pub') }}" + exclusive: "{{ authorized_keys_are_exclusive | bool }}" with_items: "{{ users }}" - ignore_errors: yes + ignore_errors: true - name: 'Ensure that wheel group is existing' group: