Merge pull request #5887 from msabramo/config.ssh.ssh_command
Add setting config.ssh.ssh_command
This commit is contained in:
commit
3cad495064
|
@ -437,6 +437,8 @@ module Vagrant
|
|||
info[:forward_agent] = @config.ssh.forward_agent
|
||||
info[:forward_x11] = @config.ssh.forward_x11
|
||||
|
||||
info[:ssh_command] = @config.ssh.ssh_command if @config.ssh.ssh_command
|
||||
|
||||
# Add in provided proxy command config
|
||||
info[:proxy_command] = @config.ssh.proxy_command if @config.ssh.proxy_command
|
||||
|
||||
|
|
|
@ -158,17 +158,20 @@ module Vagrant
|
|||
# we really don't care since both work.
|
||||
ENV["nodosfilewarning"] = "1" if Platform.cygwin?
|
||||
|
||||
ssh = ssh_info[:ssh_command] || 'ssh'
|
||||
|
||||
# Invoke SSH with all our options
|
||||
if !opts[:subprocess]
|
||||
LOGGER.info("Invoking SSH: #{command_options.inspect}")
|
||||
SafeExec.exec("ssh", *command_options)
|
||||
LOGGER.info("Invoking SSH: #{ssh} #{command_options.inspect}")
|
||||
# msabramo
|
||||
SafeExec.exec(ssh, *command_options)
|
||||
return
|
||||
end
|
||||
|
||||
# If we're still here, it means we're supposed to subprocess
|
||||
# out to ssh rather than exec it.
|
||||
LOGGER.info("Executing SSH in subprocess: #{command_options.inspect}")
|
||||
process = ChildProcess.build("ssh", *command_options)
|
||||
LOGGER.info("Executing SSH in subprocess: #{ssh} #{command_options.inspect}")
|
||||
process = ChildProcess.build(ssh, *command_options)
|
||||
process.io.inherit!
|
||||
process.start
|
||||
process.wait
|
||||
|
|
|
@ -40,7 +40,8 @@ module VagrantPlugins
|
|||
private_key_path: ssh_info[:private_key_path],
|
||||
forward_agent: ssh_info[:forward_agent],
|
||||
forward_x11: ssh_info[:forward_x11],
|
||||
proxy_command: ssh_info[:proxy_command]
|
||||
proxy_command: ssh_info[:proxy_command],
|
||||
ssh_command: ssh_info[:ssh_command]
|
||||
}
|
||||
|
||||
# Render the template and output directly to STDOUT
|
||||
|
|
|
@ -11,6 +11,7 @@ module VagrantPlugins
|
|||
attr_accessor :keep_alive
|
||||
attr_accessor :shell
|
||||
attr_accessor :proxy_command
|
||||
attr_accessor :ssh_command
|
||||
attr_accessor :pty
|
||||
attr_accessor :sudo_command
|
||||
|
||||
|
@ -24,6 +25,7 @@ module VagrantPlugins
|
|||
@guest_port = UNSET_VALUE
|
||||
@keep_alive = UNSET_VALUE
|
||||
@proxy_command = UNSET_VALUE
|
||||
@ssh_command = UNSET_VALUE
|
||||
@pty = UNSET_VALUE
|
||||
@shell = UNSET_VALUE
|
||||
@sudo_command = UNSET_VALUE
|
||||
|
@ -46,6 +48,7 @@ module VagrantPlugins
|
|||
@guest_port = 22 if @guest_port == UNSET_VALUE
|
||||
@keep_alive = true if @keep_alive == UNSET_VALUE
|
||||
@proxy_command = nil if @proxy_command == UNSET_VALUE
|
||||
@ssh_command = nil if @ssh_command == UNSET_VALUE
|
||||
@pty = false if @pty == UNSET_VALUE
|
||||
@shell = "bash -l" if @shell == UNSET_VALUE
|
||||
|
||||
|
|
Loading…
Reference in New Issue