Sha256: 7125edd6ce06602d6c139f005c33615b0b11d74d1112708050a28da98d34d1fa

Contents?: true

Size: 1.71 KB

Versions: 9

Compression:

Stored size: 1.71 KB

Contents

require "vagrant"

module VagrantWindows
  module Config
    class WinRM < Vagrant.plugin("2", :config)

      attr_accessor :username
      attr_accessor :password
      attr_accessor :host
      attr_accessor :port
      attr_accessor :guest_port
      attr_accessor :max_tries
      attr_accessor :timeout
      
      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

      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.host cannot be nil."       if machine.config.winrm.host.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

      def finalize!
        @username = "vagrant" if @username == UNSET_VALUE
        @password = "vagrant" if @password == UNSET_VALUE
        @host = "localhost"   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

    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
vagrant-plugin-dummy-0.0.7 windows/config/winrm.rb
vagrant-plugin-dummy-0.0.6 windows/config/winrm.rb
vagrant-plugin-dummy-0.0.5 windows/config/winrm.rb
vagrant-plugin-dummy-0.0.4 windows/config/winrm.rb
vagrant-plugin-dummy-0.0.3 windows/config/winrm.rb
vagrant-windows-1.2.1 lib/vagrant-windows/config/winrm.rb
vagrant-plugin-dummy-0.0.1 windows/config/winrm.rb
vagrant-plugin-dummy-0.0.2 windows/config/winrm.rb
vagrant-windows-1.2.0 lib/vagrant-windows/config/winrm.rb