Skip to content

Instantly share code, notes, and snippets.

@kalmanolah
Created January 17, 2014 23:44
Show Gist options
  • Save kalmanolah/8483788 to your computer and use it in GitHub Desktop.
Save kalmanolah/8483788 to your computer and use it in GitHub Desktop.
Bash script for installing and running the latest version of puppet on a machine running debian wheezy.
#!/bin/bash
# Bash script for installing and running the latest version
# of puppet on a machine running debian wheezy
# Set some variables
puppet_server="puppet.example.com"
sleep_time="120"
# Add PuppetLabs repo
cat > /etc/apt/sources.list.d/puppetlabs.list << EOL
deb http://apt.puppetlabs.com wheezy main devel dependencies
deb-src http://apt.puppetlabs.com wheezy main devel dependencies
EOL
# Get key
apt-key adv --keyserver pgp.mit.edu --recv 4BD6EC30
# Update
apt-get update
# Finally, install
apt-get install -y puppet
# Once we're done installing, run puppet
puppet agent -t --server $puppet_server
# At this point, we still need to sign the cert,
# so we should sleep for a few minutes
sleep $sleep_time
# Our cert should be signed now,
# so we perform our final puppet run
puppet agent -t --server $puppet_server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment