How can I insert an SSH key before a specific comment line in a file using Ansible?
I need to insert an SSH public key into a user’s authorized_keys root
file before a specific comment line (e.g., # service keys) using Ansible. The layout of the authorized_keys file looks like this: