Skip to content

Instantly share code, notes, and snippets.

@omarqureshi
Last active January 2, 2016 11:59
Show Gist options
  • Save omarqureshi/8300236 to your computer and use it in GitHub Desktop.
Save omarqureshi/8300236 to your computer and use it in GitHub Desktop.
#!/bin/bash
# upgrade all packages
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get -y upgrade
# Install brightbox ruby repository
apt-get install -y python-software-properties
apt-add-repository -y ppa:brightbox/ruby-ng
# install PuppetLabs repo
wget http://apt.puppetlabs.com/puppetlabs-release-precise.deb
dpkg -i puppetlabs-release-precise.deb
# Install puppet
sudo apt-get update
sudo apt-get install -y puppet emacs
service puppet stop
# Remove SSL directory (will be regenerated when restarted)
rm -rf /var/lib/puppet/ssl
# Configure Puppet to talk to our puppet master
cat > /etc/puppet/puppet.conf <<-EOF
[main]
logdir=/var/log/puppet
vardir=/var/lib/puppet
ssldir=/var/lib/puppet/ssl
rundir=/var/run/puppet
factpath=$vardir/lib/facter
templatedir=$confdir/templates
pluginsync = true
server = puppet.buddyapp.org
[master]
# These are needed when the puppetmaster is run by passenger
# and can safely be removed if webrick is used.
ssl_client_header = SSL_CLIENT_S_DN
ssl_client_verify_header = SSL_CLIENT_VERIFY
storeconfigs = true
storeconfigs_backend = puppetdb
report = true
reports = hipchat
[agent]
report = true
pluginsync = true
EOF
# Start the puppet service
cat > /etc/default/puppet <<-EOF
# Defaults for puppet - sourced by /etc/init.d/puppet
# Start puppet on boot?
START=yes
# Startup options
DAEMON_OPTS=""
EOF
service puppet start
# Clean up
export DEBIAN_FRONTEND=dialog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment