Class: VagrantWindows::Config::WinRM
- Inherits:
-
Object
- Object
- VagrantWindows::Config::WinRM
- Defined in:
- lib/vagrant-windows/config/winrm.rb
Instance Attribute Summary collapse
-
#guest_port ⇒ Object
Returns the value of attribute guest_port.
-
#host ⇒ Object
Returns the value of attribute host.
-
#max_tries ⇒ Object
Returns the value of attribute max_tries.
-
#password ⇒ Object
Returns the value of attribute password.
-
#port ⇒ Object
Returns the value of attribute port.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
- #finalize! ⇒ Object
-
#initialize ⇒ WinRM
constructor
A new instance of WinRM.
- #validate(machine) ⇒ Object
Constructor Details
#initialize ⇒ WinRM
Returns a new instance of WinRM.
15 16 17 18 19 20 21 22 23 |
# File 'lib/vagrant-windows/config/winrm.rb', line 15 def initialize @username = UNSET_VALUE @password = UNSET_VALUE @host = UNSET_VALUE @port = UNSET_VALUE @guest_port = UNSET_VALUE @max_tries = UNSET_VALUE @timeout = UNSET_VALUE end |
Instance Attribute Details
#guest_port ⇒ Object
Returns the value of attribute guest_port.
11 12 13 |
# File 'lib/vagrant-windows/config/winrm.rb', line 11 def guest_port @guest_port end |
#host ⇒ Object
Returns the value of attribute host.
9 10 11 |
# File 'lib/vagrant-windows/config/winrm.rb', line 9 def host @host end |
#max_tries ⇒ Object
Returns the value of attribute max_tries.
12 13 14 |
# File 'lib/vagrant-windows/config/winrm.rb', line 12 def max_tries @max_tries end |
#password ⇒ Object
Returns the value of attribute password.
8 9 10 |
# File 'lib/vagrant-windows/config/winrm.rb', line 8 def password @password end |
#port ⇒ Object
Returns the value of attribute port.
10 11 12 |
# File 'lib/vagrant-windows/config/winrm.rb', line 10 def port @port end |
#timeout ⇒ Object
Returns the value of attribute timeout.
13 14 15 |
# File 'lib/vagrant-windows/config/winrm.rb', line 13 def timeout @timeout end |
#username ⇒ Object
Returns the value of attribute username.
7 8 9 |
# File 'lib/vagrant-windows/config/winrm.rb', line 7 def username @username end |
Instance Method Details
#finalize! ⇒ Object
38 39 40 41 42 43 44 45 46 |
# File 'lib/vagrant-windows/config/winrm.rb', line 38 def finalize! @username = "vagrant" if @username == UNSET_VALUE @password = "vagrant" if @password == UNSET_VALUE @host = nil if @host == UNSET_VALUE @port = 5985 if @port == UNSET_VALUE @guest_port = 5985 if @guest_port == UNSET_VALUE @max_tries = 20 if @max_tries == UNSET_VALUE @timeout = 1800 if @timeout == UNSET_VALUE end |
#validate(machine) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/vagrant-windows/config/winrm.rb', line 25 def validate(machine) errors = [] errors << "winrm.username cannot be nil." if machine.config.winrm.username.nil? errors << "winrm.password cannot be nil." if machine.config.winrm.password.nil? errors << "winrm.port cannot be nil." if machine.config.winrm.port.nil? errors << "winrm.guest_port cannot be nil." if machine.config.winrm.guest_port.nil? errors << "winrm.max_tries cannot be nil." if machine.config.winrm.max_tries.nil? errors << "winrm.timeout cannot be nil." if machine.config.winrm.timeout.nil? { "WinRM" => errors } end |