Skip to content

Instantly share code, notes, and snippets.

@n3r0-ch
Last active February 5, 2016 18:03
Show Gist options
  • Save n3r0-ch/61aae3cba466b77b4e2b to your computer and use it in GitHub Desktop.
Save n3r0-ch/61aae3cba466b77b4e2b to your computer and use it in GitHub Desktop.
Masterless Puppet Installation
#!/bin/bash
export DEBIAN_FRONTEND=noninteractive
export LC_ALL="en_US.UTF-8"
#Backup old puppet directory
if [ -d "/etc/puppet" ]
then
mv /etc/puppet /etc/puppet-bak
fi
#Set SSH Key Permission
chmod 600 /root/.ssh/puppet
#Add puppetlabs sources
cd ~; wget https://apt.puppetlabs.com/puppetlabs-release-trusty.deb
dpkg -i puppetlabs-release-trusty.deb
apt-get update
rm puppetlabs-release-trusty.deb
#Install git
apt-get -y install git-core
#Clone puppet repo
git clone git@puppet:wwd-internal/puppet.git /etc/puppet
#Set permissions
chmod 755 /etc/puppet/apply.sh
#Install git and puppet
#Puppet installation returns wrong error code
apt-get -y install puppet || true
#Apply puppet config
bash /etc/puppet/apply.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment