summaryrefslogtreecommitdiff
path: root/snippets/hyperstack/hyperstack.rb
diff options
context:
space:
mode:
Diffstat (limited to 'snippets/hyperstack/hyperstack.rb')
-rw-r--r--snippets/hyperstack/hyperstack.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/snippets/hyperstack/hyperstack.rb b/snippets/hyperstack/hyperstack.rb
index 2ab53c9..f46ce6b 100644
--- a/snippets/hyperstack/hyperstack.rb
+++ b/snippets/hyperstack/hyperstack.rb
@@ -1106,9 +1106,11 @@ module HyperstackVM
end
def wait_for_ssh(host)
- # Remove stale host key for this IP — VMs frequently reuse IPs after
- # delete/recreate, causing StrictHostKeyChecking to reject the new key
+ # Remove stale host keys for both the IP and the WireGuard hostname — VMs
+ # frequently reuse IPs and the same WireGuard alias after delete/recreate,
+ # causing StrictHostKeyChecking to reject the new host key.
remove_stale_host_key(host)
+ remove_stale_host_key(@config.wireguard_gateway_hostname)
info "Waiting for SSH on #{host}:#{@config.ssh_port}..."
with_polling("SSH on #{host}:#{@config.ssh_port}") do
next nil unless tcp_open?(host, @config.ssh_port)