Skip to content

Commit 1dd7868

Browse files
committed
(maint) 2008 updates
- add provisioning script - update for 1.8.x elevated interactive
1 parent b7aca4a commit 1dd7868

File tree

2 files changed

+122
-6
lines changed

2 files changed

+122
-6
lines changed

boxes/win2008r2x64-vagrant/Vagrantfile

+16-6
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,25 @@ Vagrant.configure("2") do |config|
2525
config.vm.synced_folder "puppet/modules", "/ProgramData/PuppetLabs/code/environments/production/modules"
2626

2727
# These install chocolatey, ruby, and puppet. Also runs librarian-puppet.
28-
config.vm.provision :shell, :path => "../shared/shell/PrepareWindows.ps1"
29-
config.vm.provision :shell, :path => "../shared/shell/InstallChocolatey.ps1"
28+
if Vagrant::VERSION < '1.8.0'
29+
config.vm.provision :shell, :path => "../shared/shell/PrepareWindows.ps1"
30+
config.vm.provision :shell, :path => "../shared/shell/InstallChocolatey.ps1"
31+
else
32+
config.vm.provision :shell, :path => "../shared/shell/PrepareWindows.ps1", :powershell_elevated_interactive => true
33+
config.vm.provision :shell, :path => "../shared/shell/InstallChocolatey.ps1", :powershell_elevated_interactive => true
34+
end
3035

3136

3237
if !install_pe
33-
config.vm.provision :shell, :path => "../shared/shell/InstallPuppetFromMSI.ps1"
34-
#config.vm.provision :shell, :path => "../shared/shell/PreparePuppetProvisioner.ps1"
35-
config.vm.provision :shell, :path => "../shared/shell/NotifyGuiAppsOfEnvironmentChanges.ps1"
38+
if Vagrant::VERSION < '1.8.0'
39+
#config.vm.provision :shell, :path => "../shared/shell/InstallPuppetFromMSI.ps1"
40+
#config.vm.provision :shell, :path => "../shared/shell/PreparePuppetProvisioner.ps1"
41+
config.vm.provision :shell, :path => "../shared/shell/NotifyGuiAppsOfEnvironmentChanges.ps1"
42+
else
43+
#config.vm.provision :shell, :path => "../shared/shell/InstallPuppetFromMSI.ps1", :powershell_elevated_interactive => true
44+
#config.vm.provision :shell, :path => "../shared/shell/PreparePuppetProvisioner.ps1", :powershell_elevated_interactive => true
45+
config.vm.provision :shell, :path => "../shared/shell/NotifyGuiAppsOfEnvironmentChanges.ps1", :powershell_elevated_interactive => true
46+
end
3647

3748
# Enable provisioning with Puppet stand alone. Puppet manifests
3849
# are contained in a directory path relative to this Vagrantfile.
@@ -48,7 +59,6 @@ Vagrant.configure("2") do |config|
4859
}
4960
end
5061
else
51-
#NOTE: This isn't quite working due to main.cmd installing puppet already
5262
#PE install
5363
config.pe_build.version = '3.2.1'
5464
# if you don't have $PE_DOWNLOAD_ROOT defined,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
case $operatingsystem {
2+
'windows': {
3+
Package {
4+
provider => chocolatey,
5+
#source => 'C:\vagrant\resources\packages',
6+
}
7+
}
8+
}
9+
10+
include chocolatey
11+
# or
12+
# class {'chocolatey':
13+
# chocolatey_download_url => 'file:///C:/vagrant/resources/packages/chocolatey.0.9.9.11.nupkg',
14+
# use_7zip => false,
15+
# log_output => true,
16+
# }
17+
18+
exec { 'Write Path':
19+
command => 'Write-Output $env:PATH',
20+
provider => powershell,
21+
logoutput => true
22+
}
23+
24+
exec { 'Write Posh Location':
25+
command => 'get-process powershell* | %{ Write-Host $($_.Path)}',
26+
provider => powershell,
27+
logoutput => true
28+
}
29+
30+
exec { 'Write Path exit 0':
31+
command => 'Write-Output $env:PATH; exit 0',
32+
provider => powershell,
33+
logoutput => true
34+
}
35+
36+
exec { 'Write Path unless 1':
37+
command => 'Write-Output $env:PATH; exit 0',
38+
unless => 'Write-Output "Yo"; exit 1',
39+
provider => powershell,
40+
logoutput => true
41+
}
42+
43+
exec { 'Write Path unless 0':
44+
command => 'Write-Output $env:PATH; exit 0',
45+
unless => 'Write-Output "Yo"; exit 0',
46+
provider => powershell,
47+
logoutput => true
48+
}
49+
50+
exec { 'Write Path onlyif 1':
51+
command => 'Write-Output $env:PATH; exit 0',
52+
onlyif => 'Write-Output "Yo"; exit 1',
53+
provider => powershell,
54+
logoutput => true
55+
}
56+
57+
exec { 'Write Path onlyif 0':
58+
command => 'Write-Output $env:PATH; exit 0',
59+
onlyif => 'Write-Output "Yo"; exit 0',
60+
provider => powershell,
61+
logoutput => true
62+
}
63+
64+
exec { 'Set Temp Env':
65+
command => '$env:PATHTEMP="123"',
66+
provider => powershell,
67+
logoutput => true
68+
} ->
69+
70+
exec { 'Write Temp Env':
71+
command => 'Write-Output "PATHTEMP=$($env:PATHTEMP) (should be empty)"',
72+
provider => powershell,
73+
logoutput => true
74+
}
75+
76+
# add windows features
77+
windowsfeature { 'Web-WebServer':
78+
} ->
79+
windowsfeature { 'Web-Asp-Net':
80+
} ->
81+
82+
# remove default web site
83+
iis::manage_site {'Default Web Site':
84+
ensure => absent,
85+
site_path => 'any',
86+
app_pool => 'DefaultAppPool'
87+
} ->
88+
89+
# application in iis
90+
iis::manage_app_pool { 'newpool':
91+
enable_32_bit => true,
92+
managed_runtime_version => 'v4.0',
93+
} ->
94+
iis::manage_site {'The Server':
95+
site_path => 'c:/inetpub/wwwroot',
96+
port => "80",
97+
ip_address => '*',
98+
app_pool => "newpool",
99+
}
100+
101+
102+
# package {'windirstat':
103+
# ensure => installed,
104+
# #ensure => absent,
105+
# # install_options => ['-override', '-installArgs', '"', '/VERYSILENT', '/NORESTART', '"']
106+
# }

0 commit comments

Comments
 (0)