vagrant-windows 1.3.0.pre.3 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -1
- data/README.md +12 -0
- data/init.pp +5 -0
- data/lib/vagrant-windows/communication/winrmcommunicator.rb +1 -1
- data/lib/vagrant-windows/guest/cap/configure_networks.rb +25 -23
- data/lib/vagrant-windows/monkey_patches/plugins/provisioners/puppet/provisioner/puppet.rb +16 -7
- data/lib/vagrant-windows/scripts/cheftask.ps1.erb +13 -12
- data/lib/vagrant-windows/scripts/cheftask.xml.erb +1 -1
- data/lib/vagrant-windows/scripts/cheftaskrun.ps1.erb +3 -1
- data/lib/vagrant-windows/version.rb +1 -1
- data/puppet-3.3.2.msi +0 -0
- metadata +11 -6
data/Gemfile
CHANGED
@@ -7,6 +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.
|
10
|
+
gem "vagrant", :git => "git://github.com/mitchellh/vagrant.git", :tag => 'v1.3.5'
|
11
11
|
gem "mocha", :require => false
|
12
12
|
end
|
data/README.md
CHANGED
@@ -47,6 +47,18 @@ These commands assume you're running from a regular command window and not Power
|
|
47
47
|
winrm set winrm/config/service/auth @{Basic="true"}
|
48
48
|
sc config WinRM start= auto
|
49
49
|
```
|
50
|
+
|
51
|
+
#### Additional WinRM 1.1 Configuration
|
52
|
+
|
53
|
+
These additional configuration steps are specific to Windows7 and Windows Server 2008 (WinRM 1.1). For Windows Server 2008 R2 and newer 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).
|
57
|
+
```
|
58
|
+
netsh firewall add portopening TCP 5985 "Port 5985"
|
59
|
+
winrm set winrm/config/listener?Address=*+Transport=HTTP @{Port="5985"}
|
60
|
+
```
|
61
|
+
|
50
62
|
### Required Windows Services
|
51
63
|
|
52
64
|
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:
|
data/init.pp
ADDED
@@ -90,7 +90,7 @@ module VagrantWindows
|
|
90
90
|
if shell.eql? :cmd
|
91
91
|
winrmshell.cmd(command, &block)[:exitcode]
|
92
92
|
else
|
93
|
-
command = VagrantWindows.load_script("command_alias.ps1") << "\r\n" << command
|
93
|
+
command = VagrantWindows.load_script("command_alias.ps1") << "\r\n" << command << "\r\nexit $LASTEXITCODE"
|
94
94
|
winrmshell.powershell(command, &block)[:exitcode]
|
95
95
|
end
|
96
96
|
end
|
@@ -17,29 +17,31 @@ module VagrantWindows
|
|
17
17
|
|
18
18
|
windows_machine = VagrantWindows::WindowsMachine.new(machine)
|
19
19
|
guest_network = VagrantWindows::Communication::GuestNetwork.new(windows_machine.winrmshell)
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
20
|
+
if windows_machine.is_vmware?()
|
21
|
+
@@logger.warn('Configuring secondary network adapters through VMware is not yet supported.')
|
22
|
+
@@logger.warn('You will need to manually configure the network adapter.')
|
23
|
+
else
|
24
|
+
vm_interface_map = create_vm_interface_map(windows_machine, guest_network)
|
25
|
+
networks.each do |network|
|
26
|
+
interface = vm_interface_map[network[:interface]+1]
|
27
|
+
if interface.nil?
|
28
|
+
@@logger.warn("Could not find interface for network #{network.inspect}")
|
29
|
+
next
|
30
|
+
end
|
31
|
+
network_type = network[:type].to_sym
|
32
|
+
if network_type == :static
|
33
|
+
guest_network.configure_static_interface(
|
34
|
+
interface[:index],
|
35
|
+
interface[:net_connection_id],
|
36
|
+
network[:ip],
|
37
|
+
network[:netmask])
|
38
|
+
elsif network_type == :dhcp
|
39
|
+
guest_network.configure_dhcp_interface(
|
40
|
+
interface[:index],
|
41
|
+
interface[:net_connection_id])
|
42
|
+
else
|
43
|
+
raise WindowsError, "#{network_type} network type is not supported, try static or dhcp"
|
44
|
+
end
|
43
45
|
end
|
44
46
|
end
|
45
47
|
guest_network.set_all_networks_to_work() if windows_machine.windows_config.set_work_network
|
@@ -1,6 +1,7 @@
|
|
1
1
|
require "#{Vagrant::source_root}/plugins/provisioners/puppet/provisioner/puppet"
|
2
2
|
require_relative '../../../../../windows_machine'
|
3
3
|
require_relative '../../../../../helper'
|
4
|
+
require_relative '../../../../../errors'
|
4
5
|
|
5
6
|
module VagrantPlugins
|
6
7
|
module Puppet
|
@@ -33,7 +34,7 @@ module VagrantPlugins
|
|
33
34
|
# This re-establishes our symbolic links if they were created between now and a reboot
|
34
35
|
@machine.communicate.execute('& net use a-non-existant-share', :error_check => false)
|
35
36
|
|
36
|
-
options = [config.options].flatten
|
37
|
+
options = [@config.options].flatten
|
37
38
|
module_paths = @module_paths.map { |_, to| to }
|
38
39
|
if !@module_paths.empty?
|
39
40
|
# Prepend the default module path
|
@@ -58,9 +59,9 @@ module VagrantPlugins
|
|
58
59
|
|
59
60
|
# Build up the custom facts if we have any
|
60
61
|
facter = ""
|
61
|
-
if
|
62
|
+
if !@config.facter.empty?
|
62
63
|
facts = []
|
63
|
-
config.facter.each do |key, value|
|
64
|
+
@config.facter.each do |key, value|
|
64
65
|
facts << "$env:FACTER_#{key}='#{value}';"
|
65
66
|
end
|
66
67
|
|
@@ -68,18 +69,26 @@ module VagrantPlugins
|
|
68
69
|
end
|
69
70
|
|
70
71
|
command = "#{facter} puppet apply #{options}"
|
71
|
-
if config.working_directory
|
72
|
-
command = "cd #{config.working_directory}; if($?) \{ #{command} \}"
|
72
|
+
if @config.working_directory
|
73
|
+
command = "cd #{@config.working_directory}; if($?) \{ #{command} \}"
|
73
74
|
end
|
74
75
|
|
75
76
|
@machine.env.ui.info I18n.t("vagrant.provisioners.puppet.running_puppet",
|
76
77
|
:manifest => @manifest_file)
|
77
78
|
|
78
|
-
@machine.communicate.sudo(command) do |type, data|
|
79
|
+
exit_status = @machine.communicate.sudo(command, :error_check => false) do |type, data|
|
79
80
|
if !data.empty?
|
80
81
|
@machine.env.ui.info(data, :new_line => false, :prefix => false)
|
81
82
|
end
|
82
83
|
end
|
84
|
+
|
85
|
+
# Puppet returns 0 or 2 for success with --detailed-exitcodes
|
86
|
+
if ![0,2].include?(exit_status)
|
87
|
+
raise ::VagrantWindows::Errors::WinRMExecutionError,
|
88
|
+
:shell => :powershell,
|
89
|
+
:command => command,
|
90
|
+
:message => "Puppet failed with an exit code of #{exit_status}"
|
91
|
+
end
|
83
92
|
end
|
84
93
|
|
85
94
|
def configure_on_windows(root_config)
|
@@ -92,7 +101,7 @@ module VagrantPlugins
|
|
92
101
|
# Setup the module paths
|
93
102
|
@module_paths = []
|
94
103
|
@expanded_module_paths.each_with_index do |path, i|
|
95
|
-
@module_paths << [path, File.join(config.temp_dir, "modules-#{i}")]
|
104
|
+
@module_paths << [path, File.join(@config.temp_dir, "modules-#{i}")]
|
96
105
|
end
|
97
106
|
|
98
107
|
@logger.debug("Syncing folders from puppet configure")
|
@@ -1,8 +1,5 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
# task already exists, kill it
|
4
|
-
schtasks /delete /tn "chef-solo" /f | Out-Null
|
5
|
-
}
|
1
|
+
# kill the task so we can recreate it
|
2
|
+
schtasks /delete /tn "chef-solo" /f 2>&1 | out-null
|
6
3
|
|
7
4
|
# Ensure the chef task running file doesn't exist from a previous failure
|
8
5
|
if (Test-Path "<%= options[:chef_task_running] %>") {
|
@@ -34,14 +31,18 @@ $success = $TRUE
|
|
34
31
|
while (Test-Path "<%= options[:chef_task_running] %>") {
|
35
32
|
Start-Sleep -m 100
|
36
33
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
34
|
+
if (Test-Path "<%= options[:chef_stdout_log] %>") {
|
35
|
+
$text = (get-content "<%= options[:chef_stdout_log] %>")
|
36
|
+
$numLines = ($text | Measure-Object -line).lines
|
37
|
+
$numLinesToRead = $numLines - $numLinesRead
|
38
|
+
|
39
|
+
if ($numLinesToRead -gt 0) {
|
40
|
+
$text | select -first $numLinesToRead -skip $numLinesRead | ForEach {
|
41
|
+
Write-Host "$_"
|
42
|
+
}
|
43
|
+
$numLinesRead += $numLinesToRead
|
44
|
+
}
|
43
45
|
}
|
44
|
-
$numLinesRead += $numLinesToRead
|
45
46
|
}
|
46
47
|
|
47
48
|
exit Get-Content "<%= options[:chef_task_exitcode] %>"
|
@@ -10,7 +10,9 @@ Try
|
|
10
10
|
Finally
|
11
11
|
{
|
12
12
|
$exitCode | Out-File "<%= options[:chef_task_exitcode] %>"
|
13
|
-
|
13
|
+
if (Test-Path "<%= options[:chef_task_running] %>") {
|
14
|
+
del "<%= options[:chef_task_running] %>"
|
15
|
+
}
|
14
16
|
}
|
15
17
|
|
16
18
|
exit $exitCode
|
data/puppet-3.3.2.msi
ADDED
Binary file
|
metadata
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-windows
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.0
|
5
|
-
prerelease:
|
4
|
+
version: 1.3.0
|
5
|
+
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Paul Morton
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-11-
|
13
|
+
date: 2013-11-14 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: winrm
|
@@ -159,6 +159,7 @@ files:
|
|
159
159
|
- coverage/assets/0.7.1/smoothness/images/ui-icons_cd0a0a_256x240.png
|
160
160
|
- coverage/index.html
|
161
161
|
- Gemfile
|
162
|
+
- init.pp
|
162
163
|
- lib/vagrant-windows/communication/guestnetwork.rb
|
163
164
|
- lib/vagrant-windows/communication/winrmcommunicator.rb
|
164
165
|
- lib/vagrant-windows/communication/winrmfinder.rb
|
@@ -195,6 +196,7 @@ files:
|
|
195
196
|
- lib/vagrant-windows.rb
|
196
197
|
- LICENSE
|
197
198
|
- locales/en.yml
|
199
|
+
- puppet-3.3.2.msi
|
198
200
|
- Rakefile
|
199
201
|
- README.md
|
200
202
|
- spec/spec_helper.rb
|
@@ -228,13 +230,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
228
230
|
version: '0'
|
229
231
|
segments:
|
230
232
|
- 0
|
231
|
-
hash:
|
233
|
+
hash: 3499483992626948935
|
232
234
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
233
235
|
none: false
|
234
236
|
requirements:
|
235
|
-
- - ! '
|
237
|
+
- - ! '>='
|
236
238
|
- !ruby/object:Gem::Version
|
237
|
-
version:
|
239
|
+
version: '0'
|
240
|
+
segments:
|
241
|
+
- 0
|
242
|
+
hash: 3499483992626948935
|
238
243
|
requirements: []
|
239
244
|
rubyforge_project:
|
240
245
|
rubygems_version: 1.8.23
|