Only override the SSH host/user/etc if not specified by provider
This commit is contained in:
parent
79beefdb0a
commit
9f15fdeabc
|
@ -263,9 +263,9 @@ module Vagrant
|
||||||
|
|
||||||
# Next, we default some fields if they weren't given to us by
|
# Next, we default some fields if they weren't given to us by
|
||||||
# the provider.
|
# the provider.
|
||||||
info[:host] = @config.ssh.host if @config.ssh.host
|
info[:host] ||= @config.ssh.host if @config.ssh.host
|
||||||
info[:port] = @config.ssh.port if @config.ssh.port
|
info[:port] ||= @config.ssh.port if @config.ssh.port
|
||||||
info[:username] = @config.ssh.username if @config.ssh.username
|
info[:username] ||= @config.ssh.username if @config.ssh.username
|
||||||
|
|
||||||
# We also set some fields that are purely controlled by Varant
|
# We also set some fields that are purely controlled by Varant
|
||||||
info[:forward_agent] = @config.ssh.forward_agent
|
info[:forward_agent] = @config.ssh.forward_agent
|
||||||
|
@ -274,13 +274,13 @@ module Vagrant
|
||||||
# Set the private key path. If a specific private key is given in
|
# Set the private key path. If a specific private key is given in
|
||||||
# the Vagrantfile we set that. Otherwise, we use the default (insecure)
|
# the Vagrantfile we set that. Otherwise, we use the default (insecure)
|
||||||
# private key, but only if the provider didn't give us one.
|
# private key, but only if the provider didn't give us one.
|
||||||
|
if !info[:private_key_path]
|
||||||
if @config.ssh.private_key_path
|
if @config.ssh.private_key_path
|
||||||
info[:private_key_path] = @config.ssh.private_key_path
|
info[:private_key_path] = @config.ssh.private_key_path
|
||||||
end
|
else
|
||||||
|
|
||||||
if !info[:private_key_path]
|
|
||||||
info[:private_key_path] = @env.default_private_key_path
|
info[:private_key_path] = @env.default_private_key_path
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# Expand the private key path relative to the root path
|
# Expand the private key path relative to the root path
|
||||||
info[:private_key_path] = File.expand_path(info[:private_key_path], @env.root_path)
|
info[:private_key_path] = File.expand_path(info[:private_key_path], @env.root_path)
|
||||||
|
|
Loading…
Reference in New Issue