You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 updated public_key value does not trigger an update.
ISSUE TYPE
Bug Report
COMPONENT NAME
hetzner.hcloud.ssh_key module in the hetzner.hcloud collection.
- name: "Generate ed25519 SSH key pair for bootstrapping"community.crypto.openssh_keypair:
comment: "Ansible bootstrap key"mode: "0400"path: "{{ ansible_env.HOME }}/.ssh/ansible_bootstrap_key"state: presenttype: ed25519register: bootstrap_keypair
- name: "Create a new SSH key with updated fingerprint label"hetzner.hcloud.ssh_key:
api_token: "{{ infra_hcloud_api_token }}"name: ansible-bootstrappublic_key: "{{ bootstrap_keypair.public_key }}"state: present
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.
The text was updated successfully, but these errors were encountered:
cf-sewe
changed the title
ss
ssh_key Module Does Not Update SSH Key When Public Key Changes
Oct 30, 2024
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.
The text was updated successfully, but these errors were encountered: