Merge pull request #5887 from msabramo/config.ssh.ssh_command

Add setting config.ssh.ssh_command
This commit is contained in:
Mitchell Hashimoto 2015-07-09 14:24:48 -06:00
commit 3cad495064
4 changed files with 14 additions and 5 deletions

View File

@ -437,6 +437,8 @@ module Vagrant
info[:forward_agent] = @config.ssh.forward_agent info[:forward_agent] = @config.ssh.forward_agent
info[:forward_x11] = @config.ssh.forward_x11 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 # Add in provided proxy command config
info[:proxy_command] = @config.ssh.proxy_command if @config.ssh.proxy_command info[:proxy_command] = @config.ssh.proxy_command if @config.ssh.proxy_command

View File

@ -158,17 +158,20 @@ module Vagrant
# we really don't care since both work. # we really don't care since both work.
ENV["nodosfilewarning"] = "1" if Platform.cygwin? ENV["nodosfilewarning"] = "1" if Platform.cygwin?
ssh = ssh_info[:ssh_command] || 'ssh'
# Invoke SSH with all our options # Invoke SSH with all our options
if !opts[:subprocess] if !opts[:subprocess]
LOGGER.info("Invoking SSH: #{command_options.inspect}") LOGGER.info("Invoking SSH: #{ssh} #{command_options.inspect}")
SafeExec.exec("ssh", *command_options) # msabramo
SafeExec.exec(ssh, *command_options)
return return
end end
# If we're still here, it means we're supposed to subprocess # If we're still here, it means we're supposed to subprocess
# out to ssh rather than exec it. # out to ssh rather than exec it.
LOGGER.info("Executing SSH in subprocess: #{command_options.inspect}") LOGGER.info("Executing SSH in subprocess: #{ssh} #{command_options.inspect}")
process = ChildProcess.build("ssh", *command_options) process = ChildProcess.build(ssh, *command_options)
process.io.inherit! process.io.inherit!
process.start process.start
process.wait process.wait

View File

@ -40,7 +40,8 @@ module VagrantPlugins
private_key_path: ssh_info[:private_key_path], private_key_path: ssh_info[:private_key_path],
forward_agent: ssh_info[:forward_agent], forward_agent: ssh_info[:forward_agent],
forward_x11: ssh_info[:forward_x11], 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 # Render the template and output directly to STDOUT

View File

@ -11,6 +11,7 @@ module VagrantPlugins
attr_accessor :keep_alive attr_accessor :keep_alive
attr_accessor :shell attr_accessor :shell
attr_accessor :proxy_command attr_accessor :proxy_command
attr_accessor :ssh_command
attr_accessor :pty attr_accessor :pty
attr_accessor :sudo_command attr_accessor :sudo_command
@ -24,6 +25,7 @@ module VagrantPlugins
@guest_port = UNSET_VALUE @guest_port = UNSET_VALUE
@keep_alive = UNSET_VALUE @keep_alive = UNSET_VALUE
@proxy_command = UNSET_VALUE @proxy_command = UNSET_VALUE
@ssh_command = UNSET_VALUE
@pty = UNSET_VALUE @pty = UNSET_VALUE
@shell = UNSET_VALUE @shell = UNSET_VALUE
@sudo_command = UNSET_VALUE @sudo_command = UNSET_VALUE
@ -46,6 +48,7 @@ module VagrantPlugins
@guest_port = 22 if @guest_port == UNSET_VALUE @guest_port = 22 if @guest_port == UNSET_VALUE
@keep_alive = true if @keep_alive == UNSET_VALUE @keep_alive = true if @keep_alive == UNSET_VALUE
@proxy_command = nil if @proxy_command == UNSET_VALUE @proxy_command = nil if @proxy_command == UNSET_VALUE
@ssh_command = nil if @ssh_command == UNSET_VALUE
@pty = false if @pty == UNSET_VALUE @pty = false if @pty == UNSET_VALUE
@shell = "bash -l" if @shell == UNSET_VALUE @shell = "bash -l" if @shell == UNSET_VALUE