vagrant-windows 1.2.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. data/.DS_Store +0 -0
  2. data/CHANGELOG.md +38 -0
  3. data/Gemfile +2 -1
  4. data/LICENSE +13 -0
  5. data/README.md +78 -110
  6. data/coverage/.last_run.json +1 -1
  7. data/coverage/.resultset.json +685 -210
  8. data/coverage/index.html +5333 -2355
  9. data/init.pp +5 -0
  10. data/lib/vagrant-windows/communication/winrmcommunicator.rb +49 -61
  11. data/lib/vagrant-windows/communication/winrmfinder.rb +23 -17
  12. data/lib/vagrant-windows/communication/winrmshell.rb +34 -16
  13. data/lib/vagrant-windows/communication/winrmshell_factory.rb +34 -0
  14. data/lib/vagrant-windows/config/winrm.rb +1 -2
  15. data/lib/vagrant-windows/errors.rb +2 -2
  16. data/lib/vagrant-windows/guest/cap/configure_networks.rb +33 -29
  17. data/lib/vagrant-windows/guest/cap/halt.rb +4 -0
  18. data/lib/vagrant-windows/guest/cap/mount_shared_folder.rb +31 -0
  19. data/lib/vagrant-windows/guest/windows.rb +13 -11
  20. data/lib/vagrant-windows/helper.rb +22 -1
  21. data/lib/vagrant-windows/monkey_patches/plugins/provisioners/chef/provisioner/chef_solo.rb +17 -5
  22. data/lib/vagrant-windows/monkey_patches/plugins/provisioners/puppet/provisioner/puppet.rb +54 -17
  23. data/lib/vagrant-windows/monkey_patches/plugins/provisioners/shell/provisioner.rb +36 -22
  24. data/lib/vagrant-windows/plugin.rb +4 -4
  25. data/lib/vagrant-windows/scripts/cheftask.ps1.erb +13 -12
  26. data/lib/vagrant-windows/scripts/cheftask.xml.erb +1 -1
  27. data/lib/vagrant-windows/scripts/cheftaskrun.ps1.erb +3 -1
  28. data/lib/vagrant-windows/scripts/{mount_volume.vmware.ps1.erb → mount_volume.ps1.erb} +2 -1
  29. data/lib/vagrant-windows/scripts/reboot_detect.ps1 +43 -0
  30. data/lib/vagrant-windows/version.rb +1 -1
  31. data/lib/vagrant-windows/windows_machine.rb +87 -0
  32. data/locales/en.yml +2 -5
  33. data/puppet-3.3.2.msi +0 -0
  34. data/spec/vagrant-windows/guestnetwork_spec.rb +14 -2
  35. data/spec/vagrant-windows/helper_spec.rb +1 -0
  36. data/spec/vagrant-windows/mount_shared_folder_spec.rb +34 -0
  37. data/spec/vagrant-windows/windows_config_spec.rb +26 -0
  38. data/spec/vagrant-windows/windows_machine_spec.rb +65 -0
  39. data/spec/vagrant-windows/{config_spec.rb → winrm_config_spec.rb} +2 -28
  40. data/spec/vagrant-windows/winrmcommunicator_spec.rb +29 -8
  41. data/spec/vagrant-windows/winrmfinder_spec.rb +42 -0
  42. data/spec/vagrant-windows/winrmshell_spec.rb +39 -0
  43. data/test.ps1 +1 -0
  44. data/vagrant-windows.gemspec +6 -5
  45. metadata +59 -19
  46. checksums.yaml +0 -7
  47. data/lib/vagrant-windows/guest/cap/mount_virtualbox_shared_folder.rb +0 -17
  48. data/lib/vagrant-windows/guest/cap/mount_vmware_shared_folder.rb +0 -15
  49. data/lib/vagrant-windows/scripts/mount_volume.virtualbox.ps1.erb +0 -49
data/.DS_Store ADDED
Binary file
data/CHANGELOG.md ADDED
@@ -0,0 +1,38 @@
1
+ ## Changelog
2
+
3
+ 0.1.1
4
+
5
+ - Remove extra debug information from command output.
6
+
7
+ 0.1.2
8
+
9
+ - Added virtual box 4.2 support.
10
+
11
+ 0.1.3
12
+
13
+ - Added puppet provisioner.
14
+
15
+ 1.0.0
16
+
17
+ - Converted to Vagrant 1.1.x plugin architecture.
18
+
19
+ 1.0.1
20
+
21
+ - Fix #29 Monkey Patch the 4.2 driver to include read_mac_addresses.
22
+ - use read_mac_addresses in all cases.
23
+
24
+ 1.0.3
25
+
26
+ - Added vagrant shell provisioner. The built-in shell provisioner tried to chmod the target script which doesn't make sense on windows.
27
+ - Can now run the vagrant-windows plugin via bundle exec instead of vagrant plugin install (for plugin dev).The vagrant src root finding logic didn't work from a bundle, but the native Vagrant src root does.
28
+ - Readme fixes/updates.
29
+
30
+ 1.2.0
31
+
32
+ - Converted to Vagrant 1.2.x plugin architecture.
33
+ - Various networking fixes.
34
+ - Chef provisioner runs through the Windows task scheduler instead of ps_runas power shell script.
35
+
36
+ 1.2.1
37
+
38
+ - Fixed issue 91, drive mapping was failing on Vagrant 1.1.
data/Gemfile CHANGED
@@ -7,5 +7,6 @@ group :development do
7
7
  # We depend on Vagrant for development, but we don't add it as a
8
8
  # gem dependency because we expect to be installed within the
9
9
  # Vagrant environment itself using `vagrant plugin`.
10
- gem "vagrant", :git => "git://github.com/mitchellh/vagrant.git", :tag => 'v1.2.2'
10
+ gem "vagrant", :git => "git://github.com/mitchellh/vagrant.git", :tag => 'v1.3.5'
11
+ gem "mocha", :require => false
11
12
  end
data/LICENSE ADDED
@@ -0,0 +1,13 @@
1
+ Copyright (c) 2013 Paul Morton, Shawn Neal
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.
data/README.md CHANGED
@@ -1,80 +1,77 @@
1
- Installing Vagrant-Windows
2
- ==========================
1
+ # Vagrant-Windows
2
+ [![Build Status](https://travis-ci.org/WinRb/vagrant-windows.png)](https://travis-ci.org/WinRb/vagrant-windows)
3
+ [![Code Climate](https://codeclimate.com/github/WinRb/vagrant-windows.png)](https://codeclimate.com/github/WinRb/vagrant-windows)
4
+ [![Gem Version](https://badge.fury.io/rb/vagrant-windows.png)](http://badge.fury.io/rb/vagrant-windows)
3
5
 
4
- For Vagrant 1.1.x and 1.2.x execute `vagrant plugin install vagrant-windows`.
5
- For Vagrant 1.0.x execute `vagrant plugin install vagrant-windows --plugin-version 0.1.2`.
6
+ Use Windows guests with Vagrant
6
7
 
7
- ### Installing Vagrant-Windows From Source
8
- If you want to install from source, use the following method (this would be for 1.2.0):
8
+ ## Getting Started
9
+ 1. Install the vagrant-windows plugin.
10
+ 2. Create and configure a Windows guest base box.
11
+ 3. Create a Vagrantfile.
12
+ 4. vagrant up
9
13
 
10
- ```
11
- bundle install
12
- bundle exec rake
13
- vagrant plugin install pkg/vagrant-windows-1.2.0.gem
14
- ```
14
+ ## Installation
15
15
 
16
- Keep in mind you should have Ruby 1.9.3 and Ruby DevKit installed. Check out the following gist that can get you what you need (from blank system to fully ready): [Install Vagrant Windows Plugin From Source Gist](https://gist.github.com/ferventcoder/6251225).
16
+ - For Vagrant 1.1 and above execute `vagrant plugin install vagrant-windows`.
17
+ - For Vagrant 1.0 execute `vagrant plugin install vagrant-windows --plugin-version 0.1.2`.
17
18
 
18
- Supported Guest Operating Systems (Your VM)
19
- ===========================================
20
- _Does NOT work with Windows 2003 or XP_
19
+ ## Creating a Base Box
21
20
 
21
+ Supported Guest Operating Systems:
22
22
  - Windows 7
23
- - Windows 2008
24
- - Windows 2008 R2
25
- - Windows 2012
26
23
  - Windows 8
24
+ - Windows Server 2008
25
+ - Windows Server 2008 R2
26
+ - Windows Server 2012
27
27
 
28
- Building a Base Box
29
- ===================
30
-
31
- All Windows Machines
32
- --------------------
33
- #### Prerequisites
28
+ Windows Server 2003 and Windows XP are not supported by the maintainers of this project. Any issues regarding any unsupported guest OS will be closed. If you still insist on using XP or Server 2003, [this](http://stackoverflow.com/a/18593425/18475) may help.
34
29
 
35
- Box setup:
30
+ You'll need to create a new Vagrant base box. Create a new Windows VM in VirtualBox, configure some Windows settings (see below) then follow the [Vagrant packaging instructions](http://docs.vagrantup.com/v2/cli/package.html).
36
31
 
37
32
  - Create a vagrant user, for things to work out of the box username and password should both be "vagrant".
38
33
  - Turn off UAC (Msconfig)
39
34
  - Disable complex passwords
35
+ - [Disable Shutdown Tracker](http://www.jppinto.com/2010/01/how-to-disable-the-shutdown-event-tracker-in-server-20032008/) on Windows 2008/2012 Servers (except Core).
36
+ - [Disable "Server Manager" Starting at login](http://www.elmajdal.net/win2k8/How_to_Turn_Off_The_Automatic_Display_of_Server_Manager_At_logon.aspx) on Windows 2008/2012 Servers (except Core).
37
+ - Enable and configure WinRM (see below)
40
38
 
41
- Prior to enabling WinRM, you must ensure the following services are enabled:
39
+ ### WinRM Configuration
42
40
 
43
- - Base Filtering Engine
44
- - Remote Procedure Call (RPC)
45
- - DCOM Server Process Launcher
46
- - RPC Endpoint Mapper
47
- - Windows Firewall
48
- - Windows Remote Management (WS-Management)
49
-
50
- #### Enable WinRM
41
+ These commands assume you're running from a regular command window and not PowerShell.
51
42
  ```
52
43
  winrm quickconfig -q
53
44
  winrm set winrm/config/winrs @{MaxMemoryPerShellMB="512"}
54
45
  winrm set winrm/config @{MaxTimeoutms="1800000"}
55
46
  winrm set winrm/config/service @{AllowUnencrypted="true"}
56
47
  winrm set winrm/config/service/auth @{Basic="true"}
48
+ sc config WinRM start= auto
57
49
  ```
58
- * note
59
- If you want to run the winrm commands from PowerShell you need to put ```@{MaxMemoryPerShellMB="512"}``` etc in single quotes:
50
+
51
+ #### Additional WinRM 1.1 Configuration
52
+
53
+ These additional configuration steps are specific to Windows Server 2008 (WinRM 1.1). For Windows Server 2008 R2, Windows 7 and later versions of Windows you can ignore this section.
54
+
55
+ 1. Ensure the Windows PowerShell feature is installed
56
+ 2. [Change the default WinRM port](http://technet.microsoft.com/en-us/library/ff520073\(v=ws.10\).aspx) (see below) or [upgrade to WinRM 2.0](http://www.microsoft.com/en-us/download/details.aspx?id=20430).
60
57
 
61
58
  ```
62
- winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="512"}'
59
+ netsh firewall add portopening TCP 5985 "Port 5985"
60
+ winrm set winrm/config/listener?Address=*+Transport=HTTP @{Port="5985"}
63
61
  ```
64
62
 
65
- #### Last steps
63
+ ### Required Windows Services
66
64
 
67
- - Optional: Start WinRM a few minutes faster by running: "sc config WinRM start= auto" (default is delayed-auto)
68
- - _Note:_ When you use the `winrm` command line tool it will always ask to set the startup to Delayed, so you may find yourself performing this a few times.
65
+ If you like to turn off optional Windows services you'll need to ensure you leave these services enabled for vagrant-windows to continue to work:
69
66
 
67
+ - Base Filtering Engine
68
+ - Remote Procedure Call (RPC)
69
+ - DCOM Server Process Launcher
70
+ - RPC Endpoint Mapper
71
+ - Windows Firewall
72
+ - Windows Remote Management (WS-Management)
70
73
 
71
- Windows 2008/2012 Servers (except Core)
72
- ---------------------------------------
73
- - [Disable Shutdown Tracker](http://www.jppinto.com/2010/01/how-to-disable-the-shutdown-event-tracker-in-server-20032008/)
74
- - [Disable "Server Manager" Starting at login](http://www.elmajdal.net/win2k8/How_to_Turn_Off_The_Automatic_Display_of_Server_Manager_At_logon.aspx)
75
-
76
- The Vagrant File
77
- ================
74
+ ## The Vagrant File
78
75
 
79
76
  Add the following to your Vagrantfile
80
77
 
@@ -122,41 +119,39 @@ Available Config Parameters:
122
119
  * ```config.winrm.max_tries``` - The number of retries to connect to WinRM, defaults to 20.
123
120
  * ```config.winrm.timeout``` - The max number of seconds to wait for a WinRM response, defaults to 1800 seconds.
124
121
 
125
- Note - You need to ensure you specify a config.windows and a config.winrm in your Vagrantfile. Currently there's a problem where
126
- Vagrant will not load the plugin config even with defaults if at least one of its values doesn't exist in the Vagrantfile.
122
+ Note - You need to ensure you specify a config.windows and a config.winrm in your Vagrantfile. Currently there's a problem where Vagrant will not load the plugin config even with defaults if at least one of its values doesn't exist in the Vagrantfile.
123
+
127
124
 
128
125
 
129
- What Works?
130
- ===========
126
+ ------------------------------------------------------------
127
+
128
+ ## What Works?
129
+
131
130
  - vagrant up|halt|reload|provision
132
131
  - Chef Vagrant Provisioner
133
132
  - Puppet Vagrant Provisioner
134
133
  - Shell Vagrant provisioner. Batch files or PowerShell (ps1) scripts are supported as well as inline scripts.
135
134
 
136
- TODOs
137
- =========
138
- 1. Test it! We need to test on more hosts, guests, and VBox versions. Help wanted.
139
- 2. Chef-Client support.
140
- 3. Unit tests.
141
- 4. Better docs.
142
135
 
143
- Troubleshooting
144
- ===============
136
+ ## Troubleshooting
137
+
138
+ #### When I run the winrm command I get: "Error: Invalid use of command line. Type "winrm -?" for help."
139
+ - You're running the winrm command from powershell. You need to put ```@{MaxMemoryPerShellMB="512"}``` etc in single quotes:
140
+ ```
141
+ winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="512"}'
142
+ ```
145
143
 
146
- I get a 401 auth error from WinRM
147
- ---------------------------------
144
+ #### I get a 401 auth error from WinRM
148
145
  - Ensure you've followed the WinRM configuration instructions above.
149
146
  - Ensure you can manually login using the specified config.winrm.username you've specified in your Vagrantfile.
150
147
  - Ensure your password hasn't expired.
151
148
  - Ensure your password doesn't need to be changed because of policy.
152
149
 
153
- I get a non-401 error from WinRM waiting for the VM to boot
154
- -----------------------------------------------------------
150
+ #### I get a non-401 error from WinRM waiting for the VM to boot
155
151
  - Ensure you've properly setup port forwarding of WinRM
156
152
  - Make sure your VM can boot manually through VBox.
157
153
 
158
- SQL Server cookbook fails to install through Vagrant
159
- ----------------------------------------------------
154
+ #### SQL Server cookbook fails to install through Vagrant
160
155
  - Ensure UAC is turned off
161
156
  - Ensure your vagrant user is an admin on the guest
162
157
  - The SQL Server installer uses a lot of resources, ensure WinRM Quota Management is properly configured to give it enough resources.
@@ -165,21 +160,17 @@ SQL Server cookbook fails to install through Vagrant
165
160
  If all else fails try running [vagrant with debug logging](http://docs.vagrantup.com/v2/debugging.html), perhaps that will give
166
161
  you enough insight to fix the problem or file an issue.
167
162
 
168
- What Can I do to help?
169
- ======================
170
- 1. Contribute Code (See Below)
171
- 2. Test Various Scenarios and file bugs for things that dont work
172
163
 
173
- Contributing
174
- ============
164
+ ## Contributing
165
+
175
166
  1. Fork it.
176
167
  2. Create a branch (git checkout -b my_feature_branch)
177
168
  3. Commit your changes (git commit -am "Added a sweet feature")
178
169
  4. Push to the branch (git push origin my_feature_branch)
179
170
  5. Create a pull requst from your branch into master (Please be sure to provide enough detail for us to cipher what this change is doing)
180
171
 
181
- Development
182
- =============
172
+ ### Development
173
+
183
174
  Clone this repository and use [Bundler](http://gembundler.com) to get the dependencies:
184
175
 
185
176
  ```
@@ -202,9 +193,20 @@ use bundler to execute Vagrant:
202
193
  $ bundle exec vagrant up
203
194
  ```
204
195
 
196
+ ### Installing Vagrant-Windows From Source
197
+
198
+ If you want to globally install your locally built plugin from source, use the following method (this would be for 1.2.0):
199
+
200
+ ```
201
+ bundle install
202
+ bundle exec rake build
203
+ vagrant plugin install pkg/vagrant-windows-1.2.0.gem
204
+ ```
205
+
206
+ Keep in mind you should have Ruby 1.9.3 and Ruby DevKit installed. Check out the following gist that can get you what you need (from blank system to fully ready): [Install Vagrant Windows Plugin From Source Gist](https://gist.github.com/ferventcoder/6251225).
207
+
208
+ ## References and Shout Outs
205
209
 
206
- References and Shout Outs
207
- =========================
208
210
  - Chris McClimans - Vagrant Branch (https://github.com/hh/vagrant/blob/feature/winrm/)
209
211
  - Dan Wanek - WinRM GEM (https://github.com/zenchild/WinRM)
210
212
  - +1 For being super responsive to pull requests.
@@ -215,38 +217,4 @@ References and Shout Outs
215
217
  - Rob Reynolds - Updated readme installation and box configuration notes
216
218
  - stonith - Updated readme winrm config notes
217
219
  - wenns - Updated readme to advise against forwarding RDP
218
-
219
- Changelog
220
- =========
221
- 0.1.1
222
-
223
- - Remove extra debug information from command output.
224
-
225
- 0.1.2
226
-
227
- - Added virtual box 4.2 support.
228
-
229
- 0.1.3
230
-
231
- - Added puppet provisioner.
232
-
233
- 1.0.0
234
-
235
- - Converted to Vagrant 1.1.x plugin architecture.
236
-
237
- 1.0.1
238
-
239
- - Fix #29 Monkey Patch the 4.2 driver to include read_mac_addresses.
240
- - use read_mac_addresses in all cases.
241
-
242
- 1.0.3
243
-
244
- - Added vagrant shell provisioner. The built-in shell provisioner tried to chmod the target script which doesn't make sense on windows.
245
- - Can now run the vagrant-windows plugin via bundle exec instead of vagrant plugin install (for plugin dev).The vagrant src root finding logic didn't work from a bundle, but the native Vagrant src root does.
246
- - Readme fixes/updates.
247
-
248
- 1.2.0
249
-
250
- - Converted to Vagrant 1.2.x plugin architecture.
251
- - Various networking fixes.
252
- - Chef provisioner runs through the Windows task scheduler instead of ps_runas power shell script.
220
+ - Joe Fitzgerald - Added VMWare support and improved retry logic.
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "result": {
3
- "covered_percent": 65.11
3
+ "covered_percent": 57.79
4
4
  }
5
5
  }