From 17856832625efbf103cc744447984311b898cd74 Mon Sep 17 00:00:00 2001 From: Gaudenz Steinlin Date: Wed, 27 Mar 2024 23:20:03 +0100 Subject: [PATCH] Don't skip authorized SSH keys if empty Without this bugfix it's impossible to remove all authorized SSH keys without also removing the file. (cherry picked from commit dc8b46063aebc7022c6db55ffe1c1197a9395638) --- ansible/roles/root_account/tasks/main.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ansible/roles/root_account/tasks/main.yml b/ansible/roles/root_account/tasks/main.yml index 2192fbff9d..b92f716525 100644 --- a/ansible/roles/root_account/tasks/main.yml +++ b/ansible/roles/root_account/tasks/main.yml @@ -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: