diff --git a/roles/ubuntu_base/tasks/users.yml b/roles/ubuntu_base/tasks/users.yml index da87b4e..dad2a2a 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([]) }}"