Skip to content

Commit b57670b

Browse files
committed
Improve robustness of bootstrap SSH session
1 parent 63cfa7e commit b57670b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

app/models/server.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
class Server < ApplicationRecord
24
belongs_to :cluster, optional: true
35
belongs_to :api_key
@@ -67,7 +69,8 @@ def configured?
6769
# sync
6870
# reboot
6971
def bootstrap!(talos_version:)
70-
session = Net::SSH.start(ip, "root", key_data: [ENV.fetch("SSH_PRIVATE_KEY")])
72+
key_data = [ENV.fetch("SSH_PRIVATE_KEY")]
73+
session = Net::SSH.start(ip, "root", key_data:, non_interactive: true, verify_host_key: :never, timeout: 2)
7174
talos_image_url = bootstrap_image_url(talos_version:)
7275

7376
Rails.logger.info "Wiping disk #{bootstrap_disk} before bootstrapping"

0 commit comments

Comments
 (0)