Last active
May 12, 2016 08:33
-
-
Save rafalf/b101a94840af7c5598e4 to your computer and use it in GitHub Desktop.
puppet: install puppet and its modules using Powershell (bootstrapping using Powershell)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install puppet | |
$msiArgumentList = "/qn /i C:\FolderName\puppet-enterprise-3.2.0.msi /l*v C:\install_puppet.log" | |
Start-Process -FilePath msiexec.exe -ArgumentList $msiArgumentList -Wait | |
# add puppet to path | |
$SetPath = $env:Path + ";C:\Program Files (x86)\Puppet Labs\Puppet Enterprise\bin\" | |
[Environment]::SetEnvironmentVariable("Path", "$SetPath", "Machine") | |
# Reload path ( in order to install modules ) | |
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") | |
# Install puppet modules | |
$modules = @("joshcooper-powershell-0.0.2.tar.gz", | |
"puppetlabs-registry-1.0.0.tar.gz", | |
"rismoney-chocolatey-0.0.2.tar.gz" | |
) | |
foreach ($module in $modules) { | |
$module_command = "/c puppet module install --force C:\PuppetModules\" + $module + " --ignore-dependencies" | |
Start-Process -Wait "cmd.exe" -ArgumentList "$module_command" | |
} | |
#Disable pe-puppet (puppet agent) | |
Set-Service pe-puppet -startuptype "disabled" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment