Open cf-sewe opened 3 weeks ago
The API docs not provide a way to update the public key: https://docs.hetzner.cloud/#ssh-keys-update-an-ssh-key
To make this work, we must delete and create a new ssh key, would that be the behavior that you expect? I am not sure that I like the idea of magically deleting the ssh key without the user knowing.
Yes, I would have expected that the role would "update" a key if it changes (source of truth in GIT / ansible). Even if it means that a key would be deleted / recreated. Maybe a force
option could be considered as well. And the behaviour should be documented. I have now implemented the recreation myself, but of course a builtin solution is beneficial generally.
SUMMARY
The
hetzner.hcloud.ssh_key
Ansible module currently does not support updating the public key when the local SSH key changes. As a result, it is not possible to refresh the key without deleting and recreating it manually. Attempting to pass an updatedpublic_key
value does not trigger an update.ISSUE TYPE
COMPONENT NAME
hetzner.hcloud.ssh_key
module in thehetzner.hcloud
collection.ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
STEPS TO REPRODUCE
EXPECTED RESULTS
The hetzner.hcloud.ssh_key module should detect a change in the public_key and update the SSH key in Hetzner Cloud to match the new public key provided.
ACTUAL RESULTS
The module does not detect any changes and does not update the SSH key on Hetzner Cloud, even when a new public_key is provided.