---
- name: set authorized keys for root
  authorized_key:
    state: present
    user: root
    key: "{{ ssh_authorized_keys|join('\n') }}"
    exclusive: "{{ ssh_authorized_keys_exclusive|default('yes') }}"
  when: ssh_authorized_keys is defined

---
- name: set authorized keys for root
  authorized_key:
    state: present
    user: root
    key: "{{ lookup('flattened', ssh_authorized_keys, wantlist=True)|join('\n') }}"
    exclusive: "{{ ssh_authorized_keys_exclusive|default('yes') }}"
  when: ssh_authorized_keys is defined

Support nested lists of keys
ssh_authorized_keys: Support nested lists of keys
