commands/rdp: config
This commit is contained in:
parent
3d0a2959cd
commit
5b5f10e175
|
@ -48,11 +48,11 @@ module VagrantPlugins
|
||||||
end
|
end
|
||||||
|
|
||||||
host = ssh_info[:host]
|
host = ssh_info[:host]
|
||||||
port = 3389
|
port = machine.config.rdp.port
|
||||||
|
|
||||||
if host == "127.0.0.1"
|
if host == "127.0.0.1"
|
||||||
# We need to find a forwarded port...
|
# We need to find a forwarded port...
|
||||||
search_port = 3389
|
search_port = machine.config.rdp.search_port
|
||||||
ports = nil
|
ports = nil
|
||||||
if machine.provider.capability?(:forwarded_ports)
|
if machine.provider.capability?(:forwarded_ports)
|
||||||
ports = machine.provider.capability(:forwarded_ports)
|
ports = machine.provider.capability(:forwarded_ports)
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
module VagrantPlugins
|
||||||
|
module CommandRDP
|
||||||
|
class Config < Vagrant.plugin("2", :config)
|
||||||
|
attr_accessor :port
|
||||||
|
attr_accessor :search_port
|
||||||
|
|
||||||
|
def initialize
|
||||||
|
@port = UNSET_VALUE
|
||||||
|
@search_port = UNSET_VALUE
|
||||||
|
end
|
||||||
|
|
||||||
|
def finalize!
|
||||||
|
@port = 3389 if @port == UNSET_VALUE
|
||||||
|
@search_port = 3389 if @search_port == UNSET_VALUE
|
||||||
|
end
|
||||||
|
|
||||||
|
def validate(machine)
|
||||||
|
errors = _detected_errors
|
||||||
|
{ "RDP" => errors }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -17,6 +17,11 @@ module VagrantPlugins
|
||||||
Command
|
Command
|
||||||
end
|
end
|
||||||
|
|
||||||
|
config("rdp") do
|
||||||
|
require_relative "config"
|
||||||
|
Config
|
||||||
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
||||||
def self.init!
|
def self.init!
|
||||||
|
|
Loading…
Reference in New Issue