Remote command fails due to HostKeyMismatch
|Target version:||Foreman - Team Ivan backlog|
|Velocity based estimate||-|
Host has been deployed and Remote Execution tested with 'uptime' command scheduled. Working.
Host is rebuilt (same IP, MAC, hostname etc).
Remote Execution tested again with 'uptime' command. Fail.
Error message is:
Error initializing command: Net::SSH::HostKeyMismatch - fingerprint 84:2f:bc:c8:79:b8:2e:f8:50:8c:a0:66:39:62:88:d3 does not match for "192.168.122.5"
This is understandable as the new host will have a different fingerprint to the original one. Removing the offending entry in /usr/share/foreman-proxy/.ssh/known_hosts allows Remote Execution to run as expected. Should this manual stage be necessary? It's not such a niche thing to be doing (rebuilding hosts) with the advent of the "build'n'burn" mindset.
Should the old key be removed from foreman-proxy when the rebuild is initiated? Or perhaps a more robust method of key storage with the keys imported at registration time?