Skip to content

Commit

Permalink
Don't skip authorized SSH keys if empty
Browse files Browse the repository at this point in the history
Without this bugfix it's impossible to remove all authorized SSH keys
without also removing the file.

(cherry picked from commit dc8b460)
  • Loading branch information
gaudenz committed Mar 27, 2024
1 parent 058b72d commit 1785683
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions ansible/roles/root_account/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@
exclusive: '{{ root_account__authorized_keys_exclusive|bool }}'
state: 'present'
user: 'root'
when: root_account__enabled|bool and root_account__combined_authorized_keys|d() and
root_account__authorized_keys_state != 'absent'
when: root_account__enabled|bool and root_account__authorized_keys_state != 'absent'

- name: Remove /root/.ssh/authorized_keys file if requested
file:
Expand Down

0 comments on commit 1785683

Please sign in to comment.