class Util::SSH

Included Modules

Defined in:

util/ssh.cr

Constant Summary

DEFAULT_COMMAND_TIMEOUT = 30

Default SSH command timeout in seconds

DEFAULT_CONNECT_TIMEOUT = 15

Default SSH connection timeout in seconds

DEFAULT_MAX_ATTEMPTS = 20

Default number of retry attempts

DEFAULT_RETRY_DELAY = 5

Default delay between retries in seconds

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from module Util::Shell

run_shell_command(command : String, kubeconfig_path : String, hetzner_token : String, error_message : String = "", abort_on_error : Bool = true, log_prefix : String = "", print_output : Bool = true) : CommandResult run_shell_command

Instance methods inherited from module Util

default_log_prefix default_log_prefix, log_line(line, log_prefix = "") log_line, which(command) which

Class methods inherited from module Util

which(command) which

Constructor Detail

def self.new(private_ssh_key_path : String, public_ssh_key_path : String) #

[View source]

Class Method Detail

def self.calculate_fingerprint(public_ssh_key_path) #

[View source]

Instance Method Detail

def private_ssh_key_path : String #

[View source]
def public_ssh_key_path : String #

[View source]
def run(instance, port, command, use_ssh_agent, print_output = true, disable_log_prefix = false, capture_output = false) #

Run a command on a remote instance via SSH


[View source]
def wait_for_instance(instance, port, use_ssh_agent, test_command, expected_result, max_attempts : Int32 = DEFAULT_MAX_ATTEMPTS, retry_delay : Time::Span = DEFAULT_RETRY_DELAY.seconds) #

Wait for an instance to be ready by repeatedly running a test command until it returns the expected result


[View source]