vagrant-winrm-s 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZmFlZjAxNDM2ZWQ2Y2U0ODI3YzNmZjY3NWMxMTBmNDJlNmY0MTA1Yw==
4
+ ZjkyOTQ1MTlmNGMzYmE1MThiMTIyNmQ4YTYyZGIyN2Y2YzczM2JhZg==
5
5
  data.tar.gz: !binary |-
6
- NTQ5NGZjYTUzYTE0MDRjYjYzNDkzN2IwNWVhYmY2MDE5MjI4YTY4ZA==
6
+ ZWQ5NTZiNmRlZjFmOWJiNDhlNTI0YWRkZWEyYTA0Y2RiZjhmMTc0OA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MjQzOWQ3MGIzNjdhM2YxMTlhMGNlNDVkYTg2ZTgxYWJkZGNiMGM1ODg4MjRh
10
- NDJmMzgzYmNiMzQxNDJiZWYyNTc0NzU0MDhiOTM2ZmRlNDQ5ZmIyNzAyMmUy
11
- NTc0ZDE5ZWRiMjcwYTIxYTJlNTE2ODY5NTZiYTU1NDQ2OTIwNDc=
9
+ OTc3NjBkYmYyNWVkYzUwNDIzMDFlNDUzZjhjY2M2OTNkMGQ4YjI1MmFiMjli
10
+ NTNmZGQyMWIzMWU0OTA0ZjQzYmYwNjJkZDU4OGM2MGJmZjE2Njc2YzEwZDNh
11
+ NjVhZGVlMGFkOTJkYmYxOTI4YzAxNTU5NTQ3NGFlY2UyMzUzZWY=
12
12
  data.tar.gz: !binary |-
13
- YjgxMzVjOWUwZTdlNTJjNzAwNzhiNTlmYTUzYmQzM2RmZjZjMzQ5NTg5Njkz
14
- NzQ0ZGRmNWQwNTc2NTJkNTE4N2ZiNzZlMTFiNjljMmJhYjJjMDdkMGFlMjhm
15
- N2ExNWI0OGIxMmMxZGRiODM3Y2MyN2ExNDA1YWQ1Mjk3ZTRkODE=
13
+ NTY3MzQyNTdjYjBmZWM3NWYxOWMxOGZjZGFjZjNlNTA0Zjk1ZWE5ZmZmYTU5
14
+ ZmQzYWFjOTVjYzVhYTVjMjAwZGUxMDYxZjEyNjVlMDIzMTZjY2NmMThlMmZm
15
+ NjQ0NmIwMDFlM2ZmMzJiMDkzMmI4MzBmZmMxNTczOTI2MGI0YTM=
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Vagrant-WinRM-S
2
2
 
3
- Note: This plugin is only compatible with vagrant <= 1.7.2. Future versions
3
+ Note: This plugin is only compatible with vagrant >= 1.7.4. Future versions
4
4
  of Vagrant will provide this functionality natively.
5
5
 
6
6
  A Vagrant communicator that uses the `winrm-s` gem to communicate over winrm. Notably, allows for SSPI authentication of domain accounts when using a Windows host.
@@ -41,9 +41,11 @@ config.winrm.transport = :sspinegotiate
41
41
  ### What about the SSL transport?
42
42
 
43
43
  The `:ssl` transport is available and can be used to authenticate local accounts.
44
- However, the versions of `WinRM` and `HTTPClient` bundled with Vagrant make it
45
- difficult to ignore untrusted/self-signed certificates. But users with proper
46
- certificates should have no problem.
44
+ Vagrant supports SSL with/without self-signed certs out of the box as of 1.7.3.
45
+ `vagrant-winrm-s` is no longer necessary to use this transport.
46
+
47
+ Just ensure you set `config.winrm.ssl_peer_verification` to false for self-signed
48
+ certs.
47
49
 
48
50
  ## Setting up your server
49
51
 
data/changelog.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 0.0.4
2
+
3
+ * Really make it compatible with vagrant 1.7.4, which provides much of the
4
+ functionality we previously needed to out of the box, thanks to a newer
5
+ version of winrm gem.
6
+
1
7
  ## 0.0.3
2
8
 
3
9
  * Rev version of winrm-s that is being used to be compatible with Vagrant 1.7.4
@@ -1,6 +1,5 @@
1
1
  require "vagrant-winrm-s/version"
2
2
  require "vagrant-winrm-s/plugin"
3
- require "vagrant-winrm-s/config"
4
3
 
5
4
  module VagrantPlugins
6
5
  module CommunicatorWinRM
@@ -19,12 +19,9 @@ module VagrantPlugins
19
19
 
20
20
  WinRMSShell.new(
21
21
  winrm_info[:host],
22
- @machine.config.winrm.username,
23
- @machine.config.winrm.password,
24
- transport: @machine.config.winrm.transport,
25
- port: winrm_info[:port],
26
- timeout_in_seconds: @machine.config.winrm.timeout,
27
- max_tries: @machine.config.winrm.max_tries)
22
+ winrm_info[:port],
23
+ @machine.config.winrm
24
+ )
28
25
  end
29
26
 
30
27
  end
@@ -20,11 +20,6 @@ module VagrantPlugins
20
20
  init!
21
21
  WinrmSCommunicator
22
22
  end
23
-
24
- config("winrm") do
25
- require_relative "config"
26
- WinrmSConfig
27
- end
28
23
  end
29
24
  end
30
25
  end
@@ -7,7 +7,7 @@ Vagrant::Util::SilenceWarnings.silence! do
7
7
  require "winrm-s"
8
8
  end
9
9
 
10
- require "vagrant/../../plugins/communicators/winrm/file_manager"
10
+ require "winrm-fs/file_manager"
11
11
  require "vagrant/../../plugins/communicators/winrm/shell"
12
12
 
13
13
  module VagrantPlugins
@@ -15,45 +15,53 @@ module VagrantPlugins
15
15
  class WinRMSShell < WinRMShell
16
16
  include Vagrant::Util::Retryable
17
17
 
18
- attr_reader :transport
19
- attr_reader :protocol
20
-
21
- def initialize(host, username, password, options = {})
22
- super(host, username, password, options)
23
-
18
+ def initialize(host, port, options = {})
19
+ super(host, port, options)
24
20
  @logger = Log4r::Logger.new("vagrant::communication::winrmsshell")
25
- @transport = options[:transport] || :plaintext
26
- @protocol = (options[:transport] == :ssl) ? "https" : "http"
27
21
  end
28
22
 
29
23
  protected
30
24
 
25
+ def endpoint
26
+ case @config.transport.to_sym
27
+ when :ssl
28
+ "https://#{@host}:#{@port}/wsman"
29
+ when :plaintext
30
+ "http://#{@host}:#{@port}/wsman"
31
+ when :sspinegotiate
32
+ "http://#{@host}:#{@port}/wsman"
33
+ else
34
+ # rubocop:disable SignalException
35
+ # To match base vagrant style
36
+ raise Errors::WinRMInvalidTransport, transport: @config.transport
37
+ # rubocop:enable SignalException
38
+ end
39
+ end
40
+
41
+ # The only reason we're overriding this one is to get rid
42
+ # of `toggle_nori_type_casting` which is deprecated in new
43
+ # versions of winrm gem (and the deprecation message seems
44
+ # to have a bug that throws an exception)
31
45
  def new_session
32
46
  @logger.info("Attempting to connect to WinRM...")
33
47
  @logger.info(" - Host: #{@host}")
34
48
  @logger.info(" - Port: #{@port}")
35
49
  @logger.info(" - Username: #{@username}")
36
- @logger.info(" - Transport: #{@transport}")
37
- @logger.info(" - Endpoint: #{endpoint}")
50
+ @logger.info(" - Transport: #{@config.transport}")
38
51
 
39
- client = ::WinRM::WinRMWebService.new(endpoint, @transport, endpoint_options)
40
- client.set_timeout(@timeout_in_seconds)
41
- client.toggle_nori_type_casting(:off)
52
+ client = ::WinRM::WinRMWebService.new(endpoint, @config.transport.to_sym, endpoint_options)
53
+ client.set_timeout(@config.timeout)
42
54
  client
43
55
  end
44
56
 
45
- def endpoint
46
- "#{@protocol}://#{@host}:#{@port}/wsman"
47
- end
48
-
49
57
  def endpoint_options
50
58
  { user: @username,
51
59
  pass: @password,
52
60
  host: @host,
53
61
  port: @port,
54
- operation_timeout: @timeout_in_seconds,
55
- basic_auth_only: (@transport == :plaintext) }
62
+ basic_auth_only: (@config.transport == :plaintext),
63
+ no_ssl_peer_verification: !@config.ssl_peer_verification }
56
64
  end
57
- end # WinShell class
65
+ end
58
66
  end
59
67
  end
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module CommunicatorWinRMS
3
- VERSION = "0.0.3"
3
+ VERSION = "0.0.4"
4
4
  end
5
5
  end
@@ -19,9 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ["lib"]
20
20
 
21
21
  spec.add_dependency "winrm-s", "~>0.3.1"
22
- spec.add_dependency "httpclient", "~>2.4.0"
23
22
 
24
- spec.add_development_dependency "bundler", "~> 1.7"
25
23
  spec.add_development_dependency "rake", "~> 10.0"
26
24
  spec.add_development_dependency "rspec", "~> 2.99"
27
25
  spec.add_development_dependency "rubocop", "~> 0.28"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-winrm-s
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Norm MacLennan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-12 00:00:00.000000000 Z
11
+ date: 2015-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: winrm-s
@@ -24,34 +24,6 @@ dependencies:
24
24
  - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.3.1
27
- - !ruby/object:Gem::Dependency
28
- name: httpclient
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ~>
32
- - !ruby/object:Gem::Version
33
- version: 2.4.0
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ~>
39
- - !ruby/object:Gem::Version
40
- version: 2.4.0
41
- - !ruby/object:Gem::Dependency
42
- name: bundler
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ~>
46
- - !ruby/object:Gem::Version
47
- version: '1.7'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ~>
53
- - !ruby/object:Gem::Version
54
- version: '1.7'
55
27
  - !ruby/object:Gem::Dependency
56
28
  name: rake
57
29
  requirement: !ruby/object:Gem::Requirement
@@ -112,7 +84,6 @@ files:
112
84
  - changelog.md
113
85
  - lib/vagrant-winrm-s.rb
114
86
  - lib/vagrant-winrm-s/communicator.rb
115
- - lib/vagrant-winrm-s/config.rb
116
87
  - lib/vagrant-winrm-s/plugin.rb
117
88
  - lib/vagrant-winrm-s/shell.rb
118
89
  - lib/vagrant-winrm-s/version.rb
@@ -1,40 +0,0 @@
1
- require "vagrant/../../plugins/communicators/winrm/config"
2
-
3
- module VagrantPlugins
4
- module CommunicatorWinRM
5
- class WinrmSConfig < Config
6
-
7
- attr_accessor :transport
8
-
9
- def initialize
10
- super
11
- @transport = UNSET_VALUE
12
- end
13
-
14
- def finalize!
15
- @username = "vagrant" if @username == UNSET_VALUE
16
- @password = "vagrant" if @password == UNSET_VALUE
17
- @host = nil if @host == UNSET_VALUE
18
- @port = 5985 if @port == UNSET_VALUE
19
- @guest_port = 5985 if @guest_port == UNSET_VALUE
20
- @max_tries = 20 if @max_tries == UNSET_VALUE
21
- @timeout = 1800 if @timeout == UNSET_VALUE
22
- @transport = :plaintext if @transport == UNSET_VALUE
23
- end
24
-
25
- def validate(_machine)
26
- errors = []
27
-
28
- errors << "winrm.username cannot be nil." if @username.nil?
29
- errors << "winrm.password cannot be nil." if @password.nil?
30
- errors << "winrm.port cannot be nil." if @port.nil?
31
- errors << "winrm.guest_port cannot be nil." if @guest_port.nil?
32
- errors << "winrm.max_tries cannot be nil." if @max_tries.nil?
33
- errors << "winrm.timeout cannot be nil." if @timeout.nil?
34
- errors << "winrm.transport cannot be nil." if @transport.nil?
35
-
36
- { "WinRM" => errors }
37
- end
38
- end
39
- end
40
- end