Skip to content

Instantly share code, notes, and snippets.

@rafalf
Last active May 12, 2016 08:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rafalf/b101a94840af7c5598e4 to your computer and use it in GitHub Desktop.
Save rafalf/b101a94840af7c5598e4 to your computer and use it in GitHub Desktop.
puppet: install puppet and its modules using Powershell (bootstrapping using Powershell)
# 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