Skip to content

Instantly share code, notes, and snippets.

Last active August 29, 2015 14:05
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save syss/93eed16f01dc160fd3b1 to your computer and use it in GitHub Desktop.
Copy-paste script for puppet on Debian/Ubuntu
# Stefan Süss
#you only need to edit these 2 lines
DEBIAN_RLS=$(cat /etc/os-release | grep VERSION= | awk -F '(' '{print $2}' | awk -F ')' '{print $1}')
#add server IP to hosts
echo "$SERVER_IP $SERVER_DNS" >> /etc/hosts
#download the right release of puppet
#install the package
dpkg -i $PUPPET_DEB
#update sources
apt-get update
#install puppet. Needs /dev/null . otherwise it would catch the pasted input
apt-get -y install puppet < "/dev/null"
#remove templatedir
sed -i 's/templatedir/#templatedir/g' $PUPPET_CONF
#insert server
sed -i "s/.*#templatedir.*/&\nserver=${SERVER_DNS}/" $PUPPET_CONF
#start puppet agent for the first time (generates the certificate)
puppet agent --onetime --verbose --no-daemonize --waitforcert 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment