--- - name: Add public keys for root ansible.posix.authorized_key: user: root key: "{{ lookup('ansible.builtin.url', item) }}" state: present # Note: we don't remove other/existing keys with_items: "{{ (global_root_ssh_key_urls | default([])) + (root_ssh_keys | default([])) }}"