Merge pull request #399 from mrsked/manage-ssh-connection-starts

Manage SSH connection starts
This commit is contained in:
Donal McBreen
2023-08-07 14:37:34 +01:00
committed by GitHub
13 changed files with 201 additions and 43 deletions

View File

@@ -13,12 +13,12 @@ module Mrsk::Commands
def run_over_ssh(*command, host:)
"ssh".tap do |cmd|
if config.ssh_proxy && config.ssh_proxy.is_a?(Net::SSH::Proxy::Jump)
cmd << " -J #{config.ssh_proxy.jump_proxies}"
elsif config.ssh_proxy && config.ssh_proxy.is_a?(Net::SSH::Proxy::Command)
cmd << " -o ProxyCommand='#{config.ssh_proxy.command_line_template}'"
if config.ssh.proxy && config.ssh.proxy.is_a?(Net::SSH::Proxy::Jump)
cmd << " -J #{config.ssh.proxy.jump_proxies}"
elsif config.ssh.proxy && config.ssh.proxy.is_a?(Net::SSH::Proxy::Command)
cmd << " -o ProxyCommand='#{config.ssh.proxy.command_line_template}'"
end
cmd << " -t #{config.ssh_user}@#{host} '#{command.join(" ")}'"
cmd << " -t #{config.ssh.user}@#{host} '#{command.join(" ")}'"
end
end