vagrant-windows 1.0.0 → 1.0.3
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.
- data/Gemfile +7 -1
- data/Gemfile.lock +43 -9
- data/README.md +48 -10
- data/Rakefile +14 -1
- data/lib/vagrant-windows/communication/winrmcommunicator.rb +5 -3
- data/lib/vagrant-windows/guest/windows.rb +1 -8
- data/lib/vagrant-windows/helper.rb +13 -0
- data/lib/vagrant-windows/monkey_patches/chef_solo.rb +1 -1
- data/lib/vagrant-windows/monkey_patches/provisioner.rb +89 -0
- data/lib/vagrant-windows/monkey_patches/puppet.rb +2 -2
- data/lib/vagrant-windows/monkey_patches/vbox_42_driver.rb +20 -0
- data/lib/vagrant-windows/plugin.rb +6 -0
- data/lib/vagrant-windows/version.rb +1 -1
- data/lib/vagrant-windows.rb +0 -9
- data/spec/vagrant-windows/config_spec.rb +58 -0
- data/spec/vagrant-windows/helper_spec.rb +27 -0
- data/vagrant-windows.gemspec +6 -1
- metadata +93 -10
- checksums.yaml +0 -7
data/Gemfile
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
source
|
|
1
|
+
source "https://rubygems.org"
|
|
2
2
|
|
|
3
3
|
# Specify your gem's dependencies in my_gem.gemspec
|
|
4
4
|
gemspec
|
|
5
5
|
|
|
6
|
+
group :development do
|
|
7
|
+
# We depend on Vagrant for development, but we don't add it as a
|
|
8
|
+
# gem dependency because we expect to be installed within the
|
|
9
|
+
# Vagrant environment itself using `vagrant plugin`.
|
|
10
|
+
gem "vagrant", :git => "git://github.com/mitchellh/vagrant.git", :tag => 'v1.1.5'
|
|
11
|
+
end
|
data/Gemfile.lock
CHANGED
|
@@ -1,32 +1,61 @@
|
|
|
1
|
+
GIT
|
|
2
|
+
remote: git://github.com/mitchellh/vagrant.git
|
|
3
|
+
revision: 64e360814c3ad960d810456add977fd4c7d47ce6
|
|
4
|
+
tag: v1.1.5
|
|
5
|
+
specs:
|
|
6
|
+
vagrant (1.1.5)
|
|
7
|
+
childprocess (~> 0.3.7)
|
|
8
|
+
erubis (~> 2.7.0)
|
|
9
|
+
i18n (~> 0.6.0)
|
|
10
|
+
json (>= 1.5.1, < 1.8.0)
|
|
11
|
+
log4r (~> 1.1.9)
|
|
12
|
+
net-scp (~> 1.1.0)
|
|
13
|
+
net-ssh (~> 2.6.6)
|
|
14
|
+
|
|
1
15
|
PATH
|
|
2
16
|
remote: .
|
|
3
17
|
specs:
|
|
4
|
-
vagrant-windows (0.
|
|
18
|
+
vagrant-windows (1.0.3)
|
|
5
19
|
highline
|
|
6
20
|
winrm (~> 1.1.1)
|
|
7
21
|
|
|
8
22
|
GEM
|
|
9
|
-
remote:
|
|
23
|
+
remote: https://rubygems.org/
|
|
10
24
|
specs:
|
|
11
25
|
akami (1.2.0)
|
|
12
26
|
gyoku (>= 0.4.0)
|
|
13
27
|
nokogiri (>= 1.4.0)
|
|
14
|
-
builder (3.0
|
|
15
|
-
|
|
28
|
+
builder (3.2.0)
|
|
29
|
+
childprocess (0.3.9)
|
|
30
|
+
ffi (~> 1.0, >= 1.0.11)
|
|
31
|
+
diff-lcs (1.1.3)
|
|
32
|
+
erubis (2.7.0)
|
|
33
|
+
ffi (1.8.1)
|
|
16
34
|
gssapi (1.0.3)
|
|
17
35
|
ffi (>= 1.0.1)
|
|
18
|
-
gyoku (0.
|
|
36
|
+
gyoku (1.0.0)
|
|
19
37
|
builder (>= 2.1.2)
|
|
20
|
-
highline (1.6.
|
|
38
|
+
highline (1.6.18)
|
|
21
39
|
httpclient (2.2.0.2)
|
|
22
40
|
httpi (0.9.7)
|
|
23
41
|
rack
|
|
42
|
+
i18n (0.6.4)
|
|
43
|
+
json (1.7.7)
|
|
24
44
|
little-plugger (1.1.3)
|
|
45
|
+
log4r (1.1.10)
|
|
25
46
|
logging (1.6.2)
|
|
26
47
|
little-plugger (>= 1.1.3)
|
|
27
|
-
|
|
28
|
-
|
|
48
|
+
net-scp (1.1.1)
|
|
49
|
+
net-ssh (>= 2.6.5)
|
|
50
|
+
net-ssh (2.6.7)
|
|
51
|
+
nokogiri (1.5.9)
|
|
52
|
+
nori (1.1.5)
|
|
29
53
|
rack (1.5.2)
|
|
54
|
+
rake (10.0.4)
|
|
55
|
+
rspec-core (2.12.2)
|
|
56
|
+
rspec-expectations (2.12.1)
|
|
57
|
+
diff-lcs (~> 1.1.3)
|
|
58
|
+
rspec-mocks (2.12.2)
|
|
30
59
|
rubyntlm (0.1.1)
|
|
31
60
|
savon (0.9.5)
|
|
32
61
|
akami (~> 1.0)
|
|
@@ -36,7 +65,7 @@ GEM
|
|
|
36
65
|
nokogiri (>= 1.4.0)
|
|
37
66
|
nori (~> 1.0)
|
|
38
67
|
wasabi (~> 1.0)
|
|
39
|
-
uuidtools (2.1.
|
|
68
|
+
uuidtools (2.1.4)
|
|
40
69
|
wasabi (1.0.0)
|
|
41
70
|
nokogiri (>= 1.4.0)
|
|
42
71
|
winrm (1.1.2)
|
|
@@ -52,4 +81,9 @@ PLATFORMS
|
|
|
52
81
|
ruby
|
|
53
82
|
|
|
54
83
|
DEPENDENCIES
|
|
84
|
+
rake
|
|
85
|
+
rspec-core (~> 2.12.2)
|
|
86
|
+
rspec-expectations (~> 2.12.1)
|
|
87
|
+
rspec-mocks (~> 2.12.1)
|
|
88
|
+
vagrant!
|
|
55
89
|
vagrant-windows!
|
data/README.md
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
Installing Vagrant-Windows
|
|
3
2
|
==========================
|
|
4
3
|
|
|
@@ -6,6 +5,15 @@ Installing Vagrant-Windows
|
|
|
6
5
|
- Vagrant 1.1 should use <code>gem "vagrant-windows", "~> 1.0.0"</code>
|
|
7
6
|
- Vagrant 1.2 is not yet supported. There needs to be a refactor to support capabilities. We are looking for a backwards compatiable way to implement this.
|
|
8
7
|
|
|
8
|
+
Supported Guest Operating Systems (Your VM)
|
|
9
|
+
===========================================
|
|
10
|
+
_Does NOT work with Windows 2003 or XP_
|
|
11
|
+
|
|
12
|
+
- Windows 7
|
|
13
|
+
- Windows 2008
|
|
14
|
+
- Windows 2008 R2
|
|
15
|
+
- Windows 2012
|
|
16
|
+
- Windows 8
|
|
9
17
|
|
|
10
18
|
Building a Base Box
|
|
11
19
|
===================
|
|
@@ -39,7 +47,6 @@ config.vm.guest = :windows
|
|
|
39
47
|
config.windows.halt_timeout = 15
|
|
40
48
|
config.winrm.username = "vagrant"
|
|
41
49
|
config.winrm.password = "vagrant"
|
|
42
|
-
config.vm.network :forwarded_port, guest: 3389, host: 3389
|
|
43
50
|
config.vm.network :forwarded_port, guest: 5985, host: 5985
|
|
44
51
|
```
|
|
45
52
|
|
|
@@ -87,10 +94,7 @@ What Works?
|
|
|
87
94
|
- vagrant up|halt|reload|provision
|
|
88
95
|
- Chef Vagrant Provisioner
|
|
89
96
|
- Puppet Vagrant Provisioner
|
|
90
|
-
|
|
91
|
-
What has not been tested
|
|
92
|
-
========================
|
|
93
|
-
- Shell provisioning. Shell should work, though I have not vetted it yet.
|
|
97
|
+
- Shell Vagrant provisioner. Batch files or PowerShell (ps1) scripts are supported as well as inline scripts.
|
|
94
98
|
|
|
95
99
|
TODOs
|
|
96
100
|
=========
|
|
@@ -138,6 +142,19 @@ Contributing
|
|
|
138
142
|
4. Push to the branch (git push origin my_feature_branch)
|
|
139
143
|
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)
|
|
140
144
|
|
|
145
|
+
Running tests
|
|
146
|
+
=============
|
|
147
|
+
Clone this repository and use [Bundler](http://gembundler.com) to get the dependencies:
|
|
148
|
+
|
|
149
|
+
```
|
|
150
|
+
$ bundle install
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Once you have the dependencies, you can run the tests with `rake`:
|
|
154
|
+
|
|
155
|
+
```
|
|
156
|
+
$ rake spec
|
|
157
|
+
```
|
|
141
158
|
|
|
142
159
|
References and Shout Outs
|
|
143
160
|
=========================
|
|
@@ -148,10 +165,31 @@ References and Shout Outs
|
|
|
148
165
|
|
|
149
166
|
Changelog
|
|
150
167
|
=========
|
|
151
|
-
0.1.1
|
|
168
|
+
0.1.1
|
|
169
|
+
|
|
170
|
+
- Remove extra debug information from command output.
|
|
171
|
+
|
|
172
|
+
0.1.2
|
|
173
|
+
|
|
174
|
+
- Added virtual box 4.2 support.
|
|
175
|
+
|
|
176
|
+
0.1.3
|
|
177
|
+
|
|
178
|
+
- Added puppet provisioner.
|
|
179
|
+
|
|
180
|
+
1.0.0
|
|
181
|
+
|
|
182
|
+
- Converted to Vagrant 1.1.x plugin architecture.
|
|
183
|
+
|
|
184
|
+
1.0.1
|
|
185
|
+
|
|
186
|
+
- Fix #29 Monkey Patch the 4.2 driver to include read_mac_addresses.
|
|
187
|
+
- use read_mac_addresses in all cases.
|
|
152
188
|
|
|
153
|
-
|
|
189
|
+
1.0.3
|
|
154
190
|
|
|
155
|
-
|
|
191
|
+
- Added vagrant shell provisioner.
|
|
192
|
+
The built-in shell provisioner tried to chmod the target script which doesn't make sense on windows.
|
|
156
193
|
|
|
157
|
-
|
|
194
|
+
- 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.
|
|
195
|
+
- Readme fixes/updates.
|
data/Rakefile
CHANGED
|
@@ -1,2 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
require 'rubygems'
|
|
2
|
+
require 'bundler/setup'
|
|
3
|
+
require 'rspec/core/rake_task'
|
|
4
|
+
|
|
5
|
+
# Change to the directory of this file.
|
|
6
|
+
Dir.chdir(File.expand_path("../", __FILE__))
|
|
7
|
+
|
|
8
|
+
# For gem creation and bundling
|
|
2
9
|
require "bundler/gem_tasks"
|
|
10
|
+
|
|
11
|
+
# Install the `spec` task so that we can run tests.
|
|
12
|
+
RSpec::Core::RakeTask.new
|
|
13
|
+
|
|
14
|
+
# Default task is to run the unit tests
|
|
15
|
+
task :default => "build"
|
|
@@ -51,7 +51,9 @@ module VagrantWindows
|
|
|
51
51
|
:shell => :powershell
|
|
52
52
|
}.merge(opts || {})
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
if opts[:shell].eql? :powershell
|
|
55
|
+
command = VagrantWindows.load_script("command_alias.ps1") << "\r\n" << command
|
|
56
|
+
end
|
|
55
57
|
exit_status = 0
|
|
56
58
|
|
|
57
59
|
begin
|
|
@@ -113,7 +115,7 @@ module VagrantWindows
|
|
|
113
115
|
Base64.encode64(IO.binread(from)).gsub("\n",'').chars.to_a.each_slice(8000-file_name.size) do |chunk|
|
|
114
116
|
out = session.cmd( "echo #{chunk.join} >> \"#{file_name}\"" )
|
|
115
117
|
end
|
|
116
|
-
execute "mkdir [System.IO.Path]::GetDirectoryName(\"#{to}\")"
|
|
118
|
+
execute "mkdir $([System.IO.Path]::GetDirectoryName(\"#{to}\"))"
|
|
117
119
|
execute <<-EOH
|
|
118
120
|
$base64_string = Get-Content \"#{file_name}\"
|
|
119
121
|
$bytes = [System.Convert]::FromBase64String($base64_string)
|
|
@@ -210,4 +212,4 @@ module VagrantWindows
|
|
|
210
212
|
|
|
211
213
|
end #WinRM class
|
|
212
214
|
end
|
|
213
|
-
end
|
|
215
|
+
end
|
|
@@ -67,14 +67,7 @@ module VagrantWindows
|
|
|
67
67
|
|
|
68
68
|
def configure_networks(networks)
|
|
69
69
|
@logger.info("configure_networks: #{networks.inspect}")
|
|
70
|
-
|
|
71
|
-
# The VBox driver 4.0 and 4.1 implement read_mac_addresses, but 4.2 does not?
|
|
72
|
-
begin
|
|
73
|
-
driver_mac_address = @machine.provider.driver.read_mac_addresses.invert
|
|
74
|
-
rescue NoMethodError
|
|
75
|
-
driver_mac_address = {}
|
|
76
|
-
driver_mac_address[@machine.provider.driver.read_mac_address] = "macaddress1"
|
|
77
|
-
end
|
|
70
|
+
driver_mac_address = @machine.provider.driver.read_mac_addresses.invert
|
|
78
71
|
|
|
79
72
|
vm_interface_map = {}
|
|
80
73
|
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
require "#{Vagrant::source_root}/plugins/provisioners/shell/provisioner"
|
|
2
|
+
require "vagrant-windows/helper"
|
|
3
|
+
|
|
4
|
+
module VagrantPlugins
|
|
5
|
+
module Shell
|
|
6
|
+
class Provisioner < Vagrant.plugin("2", :provisioner)
|
|
7
|
+
|
|
8
|
+
include VagrantWindows::Helper
|
|
9
|
+
|
|
10
|
+
# This patch is needed until Vagrant supports Puppet on Windows guests
|
|
11
|
+
provision_on_linux = instance_method(:provision)
|
|
12
|
+
|
|
13
|
+
define_method(:provision) do
|
|
14
|
+
is_windows ? provision_on_windows() : provision_on_linux.bind(self).()
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def provision_on_windows
|
|
18
|
+
args = ""
|
|
19
|
+
args = " #{config.args}" if config.args
|
|
20
|
+
|
|
21
|
+
with_script_file do |path|
|
|
22
|
+
# Upload the script to the machine
|
|
23
|
+
@machine.communicate.tap do |comm|
|
|
24
|
+
# Ensure the uploaded script has a file extension, by default
|
|
25
|
+
# config.upload_path from vagrant core does not
|
|
26
|
+
fixed_upload_path = if File.extname(config.upload_path) == ""
|
|
27
|
+
"#{config.upload_path}#{File.extname(path.to_s)}"
|
|
28
|
+
else
|
|
29
|
+
config.upload_path
|
|
30
|
+
end
|
|
31
|
+
comm.upload(path.to_s, fixed_upload_path)
|
|
32
|
+
|
|
33
|
+
command = <<-EOH
|
|
34
|
+
$old = Get-ExecutionPolicy;
|
|
35
|
+
Set-ExecutionPolicy Unrestricted -force;
|
|
36
|
+
#{win_friendly_path(fixed_upload_path)}#{args};
|
|
37
|
+
Set-ExecutionPolicy $old -force
|
|
38
|
+
EOH
|
|
39
|
+
|
|
40
|
+
# Execute it with sudo
|
|
41
|
+
comm.sudo(command) do |type, data|
|
|
42
|
+
if [:stderr, :stdout].include?(type)
|
|
43
|
+
# Output the data with the proper color based on the stream.
|
|
44
|
+
color = type == :stdout ? :green : :red
|
|
45
|
+
|
|
46
|
+
# Note: Be sure to chomp the data to avoid the newlines that the
|
|
47
|
+
# Chef outputs.
|
|
48
|
+
@machine.env.ui.info(data.chomp, :color => color, :prefix => false)
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
protected
|
|
58
|
+
|
|
59
|
+
# This method yields the path to a script to upload and execute
|
|
60
|
+
# on the remote server. This method will properly clean up the
|
|
61
|
+
# script file if needed.
|
|
62
|
+
def with_script_file
|
|
63
|
+
if config.path
|
|
64
|
+
# Just yield the path to that file...
|
|
65
|
+
yield config.path
|
|
66
|
+
else
|
|
67
|
+
# Otherwise we have an inline script, we need to Tempfile it,
|
|
68
|
+
# and handle it specially...
|
|
69
|
+
file = Tempfile.new(['vagrant-powershell', '.ps1'])
|
|
70
|
+
|
|
71
|
+
begin
|
|
72
|
+
file.write(config.inline)
|
|
73
|
+
file.fsync
|
|
74
|
+
file.close
|
|
75
|
+
yield file.path
|
|
76
|
+
ensure
|
|
77
|
+
file.close
|
|
78
|
+
file.unlink
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
def is_windows
|
|
84
|
+
@machine.config.vm.guest.eql? :windows
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
end # Provisioner class
|
|
88
|
+
end
|
|
89
|
+
end
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
require "#{
|
|
1
|
+
require "#{Vagrant::source_root}/plugins/provisioners/puppet/provisioner/puppet"
|
|
2
2
|
|
|
3
3
|
module VagrantPlugins
|
|
4
4
|
module Puppet
|
|
@@ -85,7 +85,7 @@ module VagrantPlugins
|
|
|
85
85
|
@module_paths.each do |from, to|
|
|
86
86
|
# Sorry for the cryptic key here, but VirtualBox has a strange limit on
|
|
87
87
|
# maximum size for it and its something small (around 10)
|
|
88
|
-
root_config.vm.synced_folder(from, to)
|
|
88
|
+
root_config.vm.synced_folder(from, to, :id => "v-modules-#{count}")
|
|
89
89
|
count += 1
|
|
90
90
|
end
|
|
91
91
|
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module VagrantPlugins
|
|
2
|
+
module ProviderVirtualBox
|
|
3
|
+
module Driver
|
|
4
|
+
class Version_4_2
|
|
5
|
+
def read_mac_addresses
|
|
6
|
+
macs = {}
|
|
7
|
+
info = execute("showvminfo", @uuid, "--machinereadable", :retryable => true)
|
|
8
|
+
info.split("\n").each do |line|
|
|
9
|
+
if matcher = /^macaddress(\d+)="(.+?)"$/.match(line)
|
|
10
|
+
adapter = matcher[1].to_i
|
|
11
|
+
mac = matcher[2].to_s
|
|
12
|
+
macs[adapter] = mac
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
macs
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -16,6 +16,9 @@ require "vagrant-windows/errors"
|
|
|
16
16
|
# Add Vagrant WinRM communication channel
|
|
17
17
|
require "vagrant-windows/communication/winrmcommunicator"
|
|
18
18
|
|
|
19
|
+
# Monkey patch the vbox42 driver
|
|
20
|
+
require "vagrant-windows/monkey_patches/vbox_42_driver"
|
|
21
|
+
|
|
19
22
|
# Monkey Patch the VM object to support multiple channels, i.e. WinRM
|
|
20
23
|
require "vagrant-windows/monkey_patches/machine"
|
|
21
24
|
|
|
@@ -25,6 +28,9 @@ require "vagrant-windows/monkey_patches/puppet"
|
|
|
25
28
|
# Monkey patch the Chef-Solo provisioner to support PowerShell/Windows
|
|
26
29
|
require "vagrant-windows/monkey_patches/chef_solo"
|
|
27
30
|
|
|
31
|
+
# Monkey patch the shell provisioner to support PowerShell/batch/exe/Windows/etc
|
|
32
|
+
require "vagrant-windows/monkey_patches/provisioner"
|
|
33
|
+
|
|
28
34
|
# Add our windows specific config object
|
|
29
35
|
require "vagrant-windows/config/windows"
|
|
30
36
|
|
data/lib/vagrant-windows.rb
CHANGED
|
@@ -2,15 +2,6 @@ require "pathname"
|
|
|
2
2
|
|
|
3
3
|
module VagrantWindows
|
|
4
4
|
|
|
5
|
-
def self.vagrant_lib_root
|
|
6
|
-
# example match: /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.2/lib
|
|
7
|
-
@vagrant_lib_root ||= $LOAD_PATH.select { |p| p =~ /\/vagrant-[1-9].[0-9].[0-9]\/lib/ }.first
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
def self.vagrant_root
|
|
11
|
-
@vagrant_root ||= Pathname.new(File.expand_path("../", vagrant_lib_root))
|
|
12
|
-
end
|
|
13
|
-
|
|
14
5
|
def self.vagrant_windows_root
|
|
15
6
|
@vagrant_windows_root ||= Pathname.new(File.expand_path("../../", __FILE__))
|
|
16
7
|
end
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
require "vagrant-windows/config/windows"
|
|
2
|
+
require "vagrant-windows/config/winrm"
|
|
3
|
+
|
|
4
|
+
describe VagrantWindows::Config::Windows do
|
|
5
|
+
let(:instance) { described_class.new }
|
|
6
|
+
|
|
7
|
+
describe "defaults" do
|
|
8
|
+
subject do
|
|
9
|
+
instance.tap do |o|
|
|
10
|
+
o.finalize!
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
its("halt_timeout") { should == 30 }
|
|
15
|
+
its("halt_check_interval") { should == 1 }
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
describe "overriding defaults" do
|
|
19
|
+
[:halt_timeout, :halt_check_interval].each do |attribute|
|
|
20
|
+
it "should not default #{attribute} if overridden" do
|
|
21
|
+
instance.send("#{attribute}=".to_sym, 10)
|
|
22
|
+
instance.finalize!
|
|
23
|
+
instance.send(attribute).should == 10
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
describe VagrantWindows::Config::WinRM do
|
|
31
|
+
let(:instance) { described_class.new }
|
|
32
|
+
|
|
33
|
+
describe "defaults" do
|
|
34
|
+
subject do
|
|
35
|
+
instance.tap do |o|
|
|
36
|
+
o.finalize!
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
its("username") { should == "vagrant" }
|
|
41
|
+
its("password") { should == "vagrant" }
|
|
42
|
+
its("host") { should == "localhost" }
|
|
43
|
+
its("port") { should == 5985 }
|
|
44
|
+
its("guest_port") { should == 5985 }
|
|
45
|
+
its("max_tries") { should == 12 }
|
|
46
|
+
its("timeout") { should == 1800 }
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
describe "overriding defaults" do
|
|
50
|
+
[:username, :password, :host, :port, :guest_port, :max_tries, :timeout].each do |attribute|
|
|
51
|
+
it "should not default #{attribute} if overridden" do
|
|
52
|
+
instance.send("#{attribute}=".to_sym, 10)
|
|
53
|
+
instance.finalize!
|
|
54
|
+
instance.send(attribute).should == 10
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
require "vagrant-windows/helper"
|
|
2
|
+
|
|
3
|
+
describe VagrantWindows::Helper do
|
|
4
|
+
|
|
5
|
+
class DummyHelper
|
|
6
|
+
include VagrantWindows::Helper
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
before(:all) do
|
|
10
|
+
@dummy = DummyHelper.new
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
describe "win_friendly_path" do
|
|
14
|
+
it "should replace slashes with backslashes" do
|
|
15
|
+
@dummy.win_friendly_path('c:/tmp/dir').should eq('c:\\tmp\\dir')
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
it "should prepend c: drive if not drive specified" do
|
|
19
|
+
@dummy.win_friendly_path('/tmp/dir').should eq('c:\\tmp\\dir')
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
it "should return nil if no path specified" do
|
|
23
|
+
@dummy.win_friendly_path(nil).should be_nil
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
end
|
data/vagrant-windows.gemspec
CHANGED
|
@@ -17,4 +17,9 @@ Gem::Specification.new do |gem|
|
|
|
17
17
|
|
|
18
18
|
gem.add_runtime_dependency "winrm", "~> 1.1.1"
|
|
19
19
|
gem.add_runtime_dependency 'highline'
|
|
20
|
-
|
|
20
|
+
|
|
21
|
+
gem.add_development_dependency "rake"
|
|
22
|
+
gem.add_development_dependency "rspec-core", "~> 2.12.2"
|
|
23
|
+
gem.add_development_dependency "rspec-expectations", "~> 2.12.1"
|
|
24
|
+
gem.add_development_dependency "rspec-mocks", "~> 2.12.1"
|
|
25
|
+
end
|
metadata
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: vagrant-windows
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.3
|
|
5
|
+
prerelease:
|
|
5
6
|
platform: ruby
|
|
6
7
|
authors:
|
|
7
8
|
- Paul Morton
|
|
8
9
|
autorequire:
|
|
9
10
|
bindir: bin
|
|
10
11
|
cert_chain: []
|
|
11
|
-
date: 2013-
|
|
12
|
+
date: 2013-06-07 00:00:00.000000000 Z
|
|
12
13
|
dependencies:
|
|
13
14
|
- !ruby/object:Gem::Dependency
|
|
14
15
|
name: winrm
|
|
15
16
|
requirement: !ruby/object:Gem::Requirement
|
|
17
|
+
none: false
|
|
16
18
|
requirements:
|
|
17
19
|
- - ~>
|
|
18
20
|
- !ruby/object:Gem::Version
|
|
@@ -20,6 +22,7 @@ dependencies:
|
|
|
20
22
|
type: :runtime
|
|
21
23
|
prerelease: false
|
|
22
24
|
version_requirements: !ruby/object:Gem::Requirement
|
|
25
|
+
none: false
|
|
23
26
|
requirements:
|
|
24
27
|
- - ~>
|
|
25
28
|
- !ruby/object:Gem::Version
|
|
@@ -27,17 +30,83 @@ dependencies:
|
|
|
27
30
|
- !ruby/object:Gem::Dependency
|
|
28
31
|
name: highline
|
|
29
32
|
requirement: !ruby/object:Gem::Requirement
|
|
33
|
+
none: false
|
|
30
34
|
requirements:
|
|
31
|
-
- - '>='
|
|
35
|
+
- - ! '>='
|
|
32
36
|
- !ruby/object:Gem::Version
|
|
33
37
|
version: '0'
|
|
34
38
|
type: :runtime
|
|
35
39
|
prerelease: false
|
|
36
40
|
version_requirements: !ruby/object:Gem::Requirement
|
|
41
|
+
none: false
|
|
37
42
|
requirements:
|
|
38
|
-
- - '>='
|
|
43
|
+
- - ! '>='
|
|
39
44
|
- !ruby/object:Gem::Version
|
|
40
45
|
version: '0'
|
|
46
|
+
- !ruby/object:Gem::Dependency
|
|
47
|
+
name: rake
|
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
|
49
|
+
none: false
|
|
50
|
+
requirements:
|
|
51
|
+
- - ! '>='
|
|
52
|
+
- !ruby/object:Gem::Version
|
|
53
|
+
version: '0'
|
|
54
|
+
type: :development
|
|
55
|
+
prerelease: false
|
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
57
|
+
none: false
|
|
58
|
+
requirements:
|
|
59
|
+
- - ! '>='
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: '0'
|
|
62
|
+
- !ruby/object:Gem::Dependency
|
|
63
|
+
name: rspec-core
|
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
|
65
|
+
none: false
|
|
66
|
+
requirements:
|
|
67
|
+
- - ~>
|
|
68
|
+
- !ruby/object:Gem::Version
|
|
69
|
+
version: 2.12.2
|
|
70
|
+
type: :development
|
|
71
|
+
prerelease: false
|
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
73
|
+
none: false
|
|
74
|
+
requirements:
|
|
75
|
+
- - ~>
|
|
76
|
+
- !ruby/object:Gem::Version
|
|
77
|
+
version: 2.12.2
|
|
78
|
+
- !ruby/object:Gem::Dependency
|
|
79
|
+
name: rspec-expectations
|
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
|
81
|
+
none: false
|
|
82
|
+
requirements:
|
|
83
|
+
- - ~>
|
|
84
|
+
- !ruby/object:Gem::Version
|
|
85
|
+
version: 2.12.1
|
|
86
|
+
type: :development
|
|
87
|
+
prerelease: false
|
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
89
|
+
none: false
|
|
90
|
+
requirements:
|
|
91
|
+
- - ~>
|
|
92
|
+
- !ruby/object:Gem::Version
|
|
93
|
+
version: 2.12.1
|
|
94
|
+
- !ruby/object:Gem::Dependency
|
|
95
|
+
name: rspec-mocks
|
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
|
97
|
+
none: false
|
|
98
|
+
requirements:
|
|
99
|
+
- - ~>
|
|
100
|
+
- !ruby/object:Gem::Version
|
|
101
|
+
version: 2.12.1
|
|
102
|
+
type: :development
|
|
103
|
+
prerelease: false
|
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
105
|
+
none: false
|
|
106
|
+
requirements:
|
|
107
|
+
- - ~>
|
|
108
|
+
- !ruby/object:Gem::Version
|
|
109
|
+
version: 2.12.1
|
|
41
110
|
description: Windows Guest Support for Vagrant
|
|
42
111
|
email:
|
|
43
112
|
- pmorton@biaprotect.com
|
|
@@ -56,38 +125,52 @@ files:
|
|
|
56
125
|
- lib/vagrant-windows/config/winrm.rb
|
|
57
126
|
- lib/vagrant-windows/errors.rb
|
|
58
127
|
- lib/vagrant-windows/guest/windows.rb
|
|
128
|
+
- lib/vagrant-windows/helper.rb
|
|
59
129
|
- lib/vagrant-windows/monkey_patches/chef_solo.rb
|
|
60
130
|
- lib/vagrant-windows/monkey_patches/machine.rb
|
|
131
|
+
- lib/vagrant-windows/monkey_patches/provisioner.rb
|
|
61
132
|
- lib/vagrant-windows/monkey_patches/puppet.rb
|
|
133
|
+
- lib/vagrant-windows/monkey_patches/vbox_42_driver.rb
|
|
62
134
|
- lib/vagrant-windows/plugin.rb
|
|
63
135
|
- lib/vagrant-windows/scripts/command_alias.ps1
|
|
64
136
|
- lib/vagrant-windows/scripts/mount_volume.ps1.erb
|
|
65
137
|
- lib/vagrant-windows/scripts/ps_runas.ps1.erb
|
|
66
138
|
- lib/vagrant-windows/version.rb
|
|
67
139
|
- locales/en.yml
|
|
140
|
+
- spec/vagrant-windows/config_spec.rb
|
|
141
|
+
- spec/vagrant-windows/helper_spec.rb
|
|
68
142
|
- vagrant-windows.gemspec
|
|
69
143
|
homepage: ''
|
|
70
144
|
licenses: []
|
|
71
|
-
metadata: {}
|
|
72
145
|
post_install_message:
|
|
73
146
|
rdoc_options: []
|
|
74
147
|
require_paths:
|
|
75
148
|
- lib
|
|
76
149
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
150
|
+
none: false
|
|
77
151
|
requirements:
|
|
78
|
-
- - '>='
|
|
152
|
+
- - ! '>='
|
|
79
153
|
- !ruby/object:Gem::Version
|
|
80
154
|
version: '0'
|
|
155
|
+
segments:
|
|
156
|
+
- 0
|
|
157
|
+
hash: 459186587088148181
|
|
81
158
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
159
|
+
none: false
|
|
82
160
|
requirements:
|
|
83
|
-
- - '>='
|
|
161
|
+
- - ! '>='
|
|
84
162
|
- !ruby/object:Gem::Version
|
|
85
163
|
version: '0'
|
|
164
|
+
segments:
|
|
165
|
+
- 0
|
|
166
|
+
hash: 459186587088148181
|
|
86
167
|
requirements: []
|
|
87
168
|
rubyforge_project:
|
|
88
|
-
rubygems_version:
|
|
169
|
+
rubygems_version: 1.8.25
|
|
89
170
|
signing_key:
|
|
90
|
-
specification_version:
|
|
171
|
+
specification_version: 3
|
|
91
172
|
summary: A small gem that adds windows guest support to vagrant, uses WinRM as the
|
|
92
173
|
Communication Channel
|
|
93
|
-
test_files:
|
|
174
|
+
test_files:
|
|
175
|
+
- spec/vagrant-windows/config_spec.rb
|
|
176
|
+
- spec/vagrant-windows/helper_spec.rb
|
checksums.yaml
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
SHA1:
|
|
3
|
-
metadata.gz: 6373e5fcaeafb284ed319640b162f38d2c1fbb42
|
|
4
|
-
data.tar.gz: f292ab1b6c18eb837fd7b5d8f9b2bc34dfda6aad
|
|
5
|
-
SHA512:
|
|
6
|
-
metadata.gz: e86f29b4b5661bd43041cda843cf062735b3f66ca80a20a0c097724572a3124a4131bb809201bc8e77767e845c2a998350be3af2028108eb40c6e781dd6d0c96
|
|
7
|
-
data.tar.gz: 770f88ccf1d8bc53f22921a56dc1a27c5176b93c6bc8e4eab9336ab21d19706558a1c1f02ac3136302110313518d8275c207074db8ad5b2b76ade076edeca977
|