Class: ConfigBuilder::Model::WinRM

Inherits:
Base
  • Object
show all
Defined in:
lib/config_builder/model/winrm.rb

Overview

Vagrant WinRM credential model.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#attr, #attrs=, #call, #configure!, def_model_attribute, def_model_delegator, def_model_id, def_model_option, #eval_models, #instance_id, #instance_options, model_attributes, model_delegators, #model_delegators, model_options, new_from_hash, #with_attr

Instance Attribute Details

#basic_auth_onlyBoolean

Returns:

  • (Boolean)


7
# File 'lib/config_builder/model/winrm.rb', line 7

def_model_attribute :basic_auth_only

#codepageString

Returns:

  • (String)


11
# File 'lib/config_builder/model/winrm.rb', line 11

def_model_attribute :codepage

#execution_time_limitString

Returns:

  • (String)


65
# File 'lib/config_builder/model/winrm.rb', line 65

def_model_attribute :execution_time_limit

#guest_portFixnum

Returns The port on the guest that WinRM is running on. This is used by some providers to detect forwarded ports for WinRM. For example, if this is set to 5985 (the default), and Vagrant detects a forwarded port to port 5985 on the guest from port 4567 on the host, Vagrant will attempt to use port 4567 to talk to the guest if there is no other option.

Returns:

  • (Fixnum)

    The port on the guest that WinRM is running on. This is used by some providers to detect forwarded ports for WinRM. For example, if this is set to 5985 (the default), and Vagrant detects a forwarded port to port 5985 on the guest from port 4567 on the host, Vagrant will attempt to use port 4567 to talk to the guest if there is no other option.



41
# File 'lib/config_builder/model/winrm.rb', line 41

def_model_attribute :guest_port

#hostString

Returns The hostname or IP to WinRM into. By default this is empty, because the provider usually figures this out for you.

Returns:

  • (String)

    The hostname or IP to WinRM into. By default this is empty, because the provider usually figures this out for you.



28
# File 'lib/config_builder/model/winrm.rb', line 28

def_model_attribute :host

#max_triesFixnum

Returns Maximum number of retry attempts. By default this is 20.

Returns:

  • (Fixnum)

    Maximum number of retry attempts. By default this is 20.



45
# File 'lib/config_builder/model/winrm.rb', line 45

def_model_attribute :max_tries

#passwordString

Returns This sets a password that Vagrant will use to authenticate the WinRM user.

Returns:

  • (String)

    This sets a password that Vagrant will use to authenticate the WinRM user.



23
# File 'lib/config_builder/model/winrm.rb', line 23

def_model_attribute :password

#portFixnum

Returns The port to WinRM into. By default this is port 5985.

Returns:

  • (Fixnum)

    The port to WinRM into. By default this is port 5985.



32
# File 'lib/config_builder/model/winrm.rb', line 32

def_model_attribute :port

#retry_delayFixnum

Returns:

  • (Fixnum)


49
# File 'lib/config_builder/model/winrm.rb', line 49

def_model_attribute :retry_delay

#ssl_peer_verificationBoolean

Returns:

  • (Boolean)


61
# File 'lib/config_builder/model/winrm.rb', line 61

def_model_attribute :ssl_peer_verification

#timeoutFixnum

Returns The timeout in seconds. By default this is 1800 seconds.

Returns:

  • (Fixnum)

    The timeout in seconds. By default this is 1800 seconds.



53
# File 'lib/config_builder/model/winrm.rb', line 53

def_model_attribute :timeout

#transportString, Symbol

Returns:

  • (String, Symbol)


57
# File 'lib/config_builder/model/winrm.rb', line 57

def_model_attribute :transport

#usernameString

Returns This sets the username that Vagrant will WinRM as by default. Providers are free to override this if they detect a more appropriate user. By default this is "vagrant," since that is what most public boxes are made as.

Returns:

  • (String)

    This sets the username that Vagrant will WinRM as by default. Providers are free to override this if they detect a more appropriate user. By default this is "vagrant," since that is what most public boxes are made as.



18
# File 'lib/config_builder/model/winrm.rb', line 18

def_model_attribute :username

Instance Method Details

#to_procObject



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/config_builder/model/winrm.rb', line 67

def to_proc
  Proc.new do |global_config|
    winrm = global_config.winrm

    with_attr(:username)              { |val| winrm.username              = val }
    with_attr(:password)              { |val| winrm.password              = val }
    with_attr(:host)                  { |val| winrm.host                  = val }
    with_attr(:guest)                 { |val| winrm.guest                 = val }
    with_attr(:guest_port)            { |val| winrm.guest_port            = val }
    with_attr(:max_tries)             { |val| winrm.max_tries             = val }
    with_attr(:retry_delay)           { |val| winrm.retry_delay           = val }
    with_attr(:timeout)               { |val| winrm.timeout               = val }
    with_attr(:transport)             { |val| winrm.transport             = val.to_sym }
    with_attr(:ssl_peer_verification) { |val| winrm.ssl_peer_verification = val }
    with_attr(:execution_time_limit)  { |val| winrm.execution_time_limit  = val }
  end
end