Skip to content

Instantly share code, notes, and snippets.

View velocity303's full-sized avatar

James Jones velocity303

  • Chicago, IL, United States
View GitHub Profile
@ipcrm
ipcrm / install_puppet.ps1
Created June 7, 2016 15:52
Install Puppet using Powershell
# This script installs the windows puppet agent on windows
# from the master's pe_repo by downloading it to C:\tmp first and then running
# msiexec on it from there.
$puppet_master_server = "master.example.com"
$msi_source = "https://${puppet_master_server}:8140/packages/current/windows-x86_64/puppet-agent-x64.msi"
$msi_dest = "C:\tmp\puppet-agent-x64.msi"
# Start the agent installation process and wait for it to end before continuing.
@npwalker
npwalker / puppet_cron
Last active October 7, 2016 21:03
A puppet manifest to disable the pe-puppet daemon and instead enable a cron job to run puppet with a random starting time. This will help avoid a thundering herd problem.
$runinterval = 30 #minutes
$first_run = fqdn_rand($runinterval)
$second_run = $first_run + $runinterval
cron { 'cron.puppet':
command => "/opt/puppetlabs/bin/puppet agent -t > /dev/null",
user => "root",
minute => [ $first_run, $second_run ],
}