Class: Vagrant::Config::WinRM

Inherits:
Base
  • Object
show all
Defined in:
lib/vagrant-windows/config/winrm.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeWinRM

Returns a new instance of WinRM.



12
13
14
15
16
17
18
19
# File 'lib/vagrant-windows/config/winrm.rb', line 12

def initialize
  @username = "vagrant"
  @password = "vagrant"
  @guest_port = 5985
  @host = "localhost"
  @max_tries = 12
  @timeout = 1800
end

Instance Attribute Details

#guest_portObject

Returns the value of attribute guest_port.



8
9
10
# File 'lib/vagrant-windows/config/winrm.rb', line 8

def guest_port
  @guest_port
end

#hostObject

Returns the value of attribute host.



6
7
8
# File 'lib/vagrant-windows/config/winrm.rb', line 6

def host
  @host
end

#max_triesObject

Returns the value of attribute max_tries.



9
10
11
# File 'lib/vagrant-windows/config/winrm.rb', line 9

def max_tries
  @max_tries
end

#passwordObject

Returns the value of attribute password.



5
6
7
# File 'lib/vagrant-windows/config/winrm.rb', line 5

def password
  @password
end

#portObject

Returns the value of attribute port.



7
8
9
# File 'lib/vagrant-windows/config/winrm.rb', line 7

def port
  @port
end

#timeoutObject

Returns the value of attribute timeout.



10
11
12
# File 'lib/vagrant-windows/config/winrm.rb', line 10

def timeout
  @timeout
end

#usernameObject

Returns the value of attribute username.



4
5
6
# File 'lib/vagrant-windows/config/winrm.rb', line 4

def username
  @username
end

Instance Method Details

#validate(env, errors) ⇒ Object



21
22
23
24
25
26
# File 'lib/vagrant-windows/config/winrm.rb', line 21

def validate(env, errors)
  [:username, :password, :host, :max_tries, :timeout].each do |field|
    errors.add(I18n.t("vagrant.config.common.error_empty", :field => field)) if !instance_variable_get("@#{field}".to_sym)
  end

end