vagrant-aws-winrm 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0a02e0971fbf52b6c23a53a184516e9499ada281
4
- data.tar.gz: dcbb6111672aef8e843a80a2408db859b6633111
3
+ metadata.gz: 4aeb0b26db8e736561eea741413d6ebc9dd539d6
4
+ data.tar.gz: 14d589f4439c8fbe0e1d62dd60e98af81414cdc1
5
5
  SHA512:
6
- metadata.gz: 3844578b7beadccfbcae9c7c34436abfc7161e8e83b6705e5840923460f8c56a819a8d95e0665aacf2c8b8e1ca70e7e7e2c84eacd30d5c23eb75038d2fe66d08
7
- data.tar.gz: f6638f17b9d85a788dd58062218ca2babbcd017d5d28bc8acfbd7f82bda39213cbb4c52dd4d259413b8e59c46750d32192d81fce8d393d7f2e5ca34d31237ec5
6
+ metadata.gz: daf07e30a3cd32df7007f80b7dd25dd3340f7df93b9699b84b1f65f78a38fa5d1e5a8fb8648f7965230d5557697e9e44e19ca8bad5209f346d9475c9fdb2e126
7
+ data.tar.gz: c4523c8ad7ffb32e2d5c6129d1cb97cdc2b1914b61d40d217f5e382364107292ba00f6f7102ef26ac18c93ab4c55a649f83e5761004eb3aff9b6344d61e8c8c1
data/README.md CHANGED
@@ -18,42 +18,43 @@ In your Vagrantfile, ensure you configure values for `aws.keypair_name` and `ssh
18
18
 
19
19
  When configuring the WinRM credentials, use `Administrator` and `:aws` for the `winrm.username` and `winrm.password`, respectively.
20
20
 
21
+ Additionally, you will need to ensure that you set `aws.security_groups` with a Security Group that allows WinRM inbound (port 5985).
22
+
23
+ Finally, you can leverage `aws.user_data` to ensure that WinRM is enabled and the Windows Firewall is permitting WinRM inbound.
24
+
21
25
  Example:
22
26
 
23
27
  ```
24
28
  Vagrant.configure("2") do |config|
25
-
26
- # Other stuff
29
+ # ... other stuff
27
30
 
28
- config.vm.provider :aws do |aws, override|
29
- aws.access_key_id = "YOUR KEY"
30
- aws.secret_access_key = "YOUR SECRET KEY"
31
- aws.keypair_name = "KEYPAIR NAME"
32
- override.ssh.private_key_path = "PATH TO YOUR PRIVATE KEY"
33
- override.vm.communicator = "winrm"
34
- override.winrm.username = "Administrator"
35
- override.winrm.password = :aws
36
- override.winrm.transport = :ssl
37
- end
38
- end
39
- ```
31
+ config.vm.communicator = "winrm"
32
+ config.winrm.username = "Administrator"
40
33
 
41
- ## Setting up your server
34
+ config.vm.provider "aws" do |aws, override|
35
+ # Indicate that the password should be fetched and decrypted from AWS
36
+ override.winrm.password = :aws
42
37
 
43
- You'll have to configure WinRM to use basic authentication. As a result, it is recommended that you configure WinRM to use a HTTPS listener.
38
+ # private_key_path needed to decrypt the password
39
+ override.ssh.private_key_path = "PATH TO YOUR PRIVATE KEY"
44
40
 
45
- ```
46
- winrm quickconfig -q
47
- winrm set winrm/config/service/auth @{Basic="true"}
48
- winrm create winrm/config/Listener?Address=*+Transport=HTTPS @{CertificateThumbprint="YOUR CERT THUMBPRINT"}
49
- ```
41
+ # keypair name corresponding to private_key_path
42
+ aws.keypair_name = "KEYPAIR NAME"
50
43
 
51
- For self-signed SSL certs, you'll have to configure your Vagrantfile to set `winrm.ssl_peer_verification` to false.
44
+ # Use a security group that allows WinRM port inbound (port 5985)
45
+ aws.security_groups = ["SOME SECURITY GROUP THAT ALLOWS WINRM INBOUND"]
52
46
 
53
- See also:
47
+ # Enable WinRM on the instance
48
+ aws.user_data = <<-USERDATA
49
+ <powershell>
50
+ Enable-PSRemoting -Force
51
+ netsh advfirewall firewall add rule name="WinRM HTTP" dir=in localport=5985 protocol=TCP action=allow
52
+ </powershell>
53
+ USERDATA
54
+ end
55
+ end
54
56
 
55
- * [MSDN article about configuring WinRM](http://msdn.microsoft.com/en-us/library/aa384372\(v=vs.85\).aspx)
56
- * [WinRM gem](https://github.com/WinRb/WinRM/blob/master/README.md#ssl)
57
+ ```
57
58
 
58
59
  ## Contributing
59
60
 
@@ -12,8 +12,6 @@ module VagrantPlugins
12
12
 
13
13
  def self.winrm_info(machine)
14
14
  if machine.config.winrm.password == :aws
15
- machine.ui.info('Getting WinRM password from AWS...')
16
-
17
15
  # Call the VagrantPlugins::AWS::Action::ConnectAWS
18
16
  # middleware so we can get acces to the Fog connection
19
17
  machine.env.action_runner.run(
@@ -33,9 +31,19 @@ module VagrantPlugins
33
31
  machine = env[:machine]
34
32
  aws = env[:aws_compute]
35
33
 
36
- response = aws.get_password_data(machine.id)
37
- password_data = response.body['passwordData']
34
+ @logger.info('Getting WinRM password from AWS...')
35
+ response = aws.get_password_data(machine.id)
36
+ password_data = response.body['passwordData']
37
+
38
+ if password_data.nil?
39
+ @logger.info('WinRM password not available from AWS yet.')
40
+ @logger.debug("Raising an exception to force a retry.")
41
+ raise VagrantPlugins::CommunicatorWinRM::Errors::TransientError, error_message: 'WinRM password not available from AWS yet.'
42
+ end
43
+
38
44
  password_data_bytes = Base64.decode64(password_data)
45
+
46
+ machine.ui.info('Decrypting WinRM password from AWS...')
39
47
 
40
48
  # Try to decrypt the password data using each one of the private key files
41
49
  # set by the user until we hit one that decrypts successfully
@@ -1,7 +1,7 @@
1
1
  module VagrantPlugins
2
2
  module AWS
3
3
  module WinRM
4
- VERSION = "0.0.6"
4
+ VERSION = "0.0.7"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-aws-winrm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rafael Goodman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-04 00:00:00.000000000 Z
11
+ date: 2016-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -62,7 +62,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
62
62
  version: '0'
63
63
  requirements: []
64
64
  rubyforge_project:
65
- rubygems_version: 2.4.5.1
65
+ rubygems_version: 2.6.8
66
66
  signing_key:
67
67
  specification_version: 4
68
68
  summary: Facilitates using the AWS-EC2-provided Administrator password as the WinRM