Some examples of Ansible Playbooks for adding/updating authorized keys for SSH login.
- name: Set Authorized Key(s) from an URL
ansible.posix.authorized_key:
user: charlie
state: present
key: https://github.com/crazyuploader.keysReference: Add or Remove SSH Authorized Key - Ansible Documentation