add port option to ssh config
This commit is contained in:
parent
6630dfe2d7
commit
e72753874d
|
@ -12,9 +12,11 @@ module Vagrant
|
||||||
attr_accessor :forward_agent
|
attr_accessor :forward_agent
|
||||||
attr_accessor :forward_x11
|
attr_accessor :forward_x11
|
||||||
attr_accessor :sudo_shell
|
attr_accessor :sudo_shell
|
||||||
|
attr_accessor :port
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
@sudo_shell = "bash"
|
@sudo_shell = "bash"
|
||||||
|
@port = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
def private_key_path
|
def private_key_path
|
||||||
|
|
|
@ -154,6 +154,9 @@ module Vagrant
|
||||||
pnum = opts[:port]
|
pnum = opts[:port]
|
||||||
return pnum if pnum
|
return pnum if pnum
|
||||||
|
|
||||||
|
# Check if a port was specified in the config
|
||||||
|
return env.config.ssh.port if env.config.ssh.port
|
||||||
|
|
||||||
# Check if we have an SSH forwarded port
|
# Check if we have an SSH forwarded port
|
||||||
pnum = nil
|
pnum = nil
|
||||||
env.vm.vm.network_adapters.each do |na|
|
env.vm.vm.network_adapters.each do |na|
|
||||||
|
|
Loading…
Reference in New Issue