Skip to content

Commit 32184a6

Browse files
committed
(maint) 2012 powershell testing
1 parent 1dd7868 commit 32184a6

File tree

2 files changed

+94
-4
lines changed

2 files changed

+94
-4
lines changed

boxes/win2012r2x64-vagrant/puppet/PuppetFile

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
forge 'https://forgeapi.puppetlabs.com'
33

44
#mod 'puppetlabs-windows'
5-
mod 'puppetlabs-powershell'
5+
# using local
6+
#mod 'puppetlabs-powershell'
67
mod 'puppetlabs-acl'
78
mod 'puppetlabs-reboot'
89
mod 'puppetlabs-registry'
@@ -12,5 +13,5 @@ mod 'puppetlabs-stdlib'
1213
mod 'puppet-windowsfeature'
1314
mod 'puppet-iis'
1415
mod 'badgerious-windows_env'
16+
mod 'chocolatey-chocolatey'
1517

16-
# mod 'chocolatey-chocolatey'

boxes/win2012r2x64-vagrant/puppet/manifests/provision.pp

+91-2
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,102 @@
22
'windows': {
33
Package {
44
provider => chocolatey,
5-
source => 'C:\vagrant\resources\packages',
5+
#source => 'C:\vagrant\resources\packages',
66
}
77
}
88
}
99

10-
include chocolateyserver
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+
}
1149

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+
installmanagementtools => true,
79+
} ->
80+
windowsfeature { 'Web-Asp-Net45':
81+
} ->
82+
83+
# remove default web site
84+
iis::manage_site {'Default Web Site':
85+
ensure => absent,
86+
site_path => 'any',
87+
app_pool => 'DefaultAppPool'
88+
} ->
89+
90+
# application in iis
91+
iis::manage_app_pool { 'newpool':
92+
enable_32_bit => true,
93+
managed_runtime_version => 'v4.0',
94+
} ->
95+
iis::manage_site {'The Server':
96+
site_path => 'c:/inetpub/wwwroot',
97+
port => "80",
98+
ip_address => '*',
99+
app_pool => "newpool",
100+
}
12101
# package {'roundhouse':
13102
# ensure => '0.8.5.0',
14103
# }

0 commit comments

Comments
 (0)