From c8027778679ff31f5e97bd80e5d0514c61147155 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reynir=20Bj=C3=B6rnsson?= Date: Wed, 16 Nov 2022 16:10:10 +0100 Subject: [PATCH] Add root keys for all users And not just the last user. --- roles/ubuntu_base/tasks/users.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/roles/ubuntu_base/tasks/users.yml b/roles/ubuntu_base/tasks/users.yml index da87b4e1..dad2a2a3 100644 --- a/roles/ubuntu_base/tasks/users.yml +++ b/roles/ubuntu_base/tasks/users.yml @@ -18,6 +18,5 @@ - name: "Add ssh authorized_keys to root user" authorized_key: user: "root" - key: "{{ item.ssh_keys | join('\n') }}" + key: "{{ users | default([]) | map(attribute='ssh_keys') | join('\n') }}" exclusive: true - loop: "{{ users | default([]) }}"