Puppet Client Setup Script Jun 21st, 2013 Simple but useful script for setting up puppet on client machines #!/bin/bash if [ $# == 0 ] ; then cat <<EOF Usage: $0 DIST (wheezy,squeeze,lucid) FQDN EOF exit 2 fi DIST=$1 FQDN=$2 INSTALLED=$(dpkg-query -W --showformat='${Status}\n' puppet | grep "install ok installed") if [ "xxx" == "$DIST""xxx" ];then echo Please enter distribution exit 1 fi if [ "xxx" == "$FQDN""xxx" ]; then echo Please enter puppet master fqdn exit 1 fi if [ "xxx" == "$INSTALLED""xxx" ]; then wget http://apt.puppetlabs.com/puppetlabs-release-$DIST.deb dpkg -i puppetlabs-release-$DIST.deb apt-get update apt-get install puppet 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 server=$FQDN EOF else echo "Puppet already installed" fi