|
| 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