Ansible provides a ansible.builtin.authorized_key module which provides a lot of functionality:
- You can set
exclusive: true
to delete all other keys. - You can set
key_options: ...
. - You can list multiple keys in
key
by separating them with new lines.
Is there a way to combine all of the above?
The naive approach results in the key_options
to be applied to all keys rather than having key options per key.
Is this a case of generating authorized_keys
using ansible.builtin.file
given the exclusiveness?