Skip to content

Instantly share code, notes, and snippets.

@grahamgilbert
Created November 14, 2013 13:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grahamgilbert/7466978 to your computer and use it in GitHub Desktop.
Save grahamgilbert/7466978 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
#
# This bootstraps an OS X Puppet Client
#
# Your Puppet server here
PUPPETSERVER='puppet.grahamgilbert.dev'
TESTURL='https://raw.github.com'
PUPPET_VER=`puppet --version`
# If Puppet 3.3.1 isn't installed, it needs to be there...
if [ $PUPPET_VER != "3.3.1" ]; then
# Test for network conection. Github needs to be up for this to work, so it might as well be that
if curl --output /dev/null --silent --head --fail "$TESTURL"; then
echo "URL exists: $TESTURL"
else
exit 1
fi
# Download, install and configure Puppet and Facter
curl -o /tmp/install_puppet.py https://raw.github.com/grahamgilbert/macscripts/master/Puppet-Install/install_puppet.py; python /tmp/install_puppet.py --appendhosts --server $PUPPETSERVER --serial
fi
# Run Puppet
puppet agent -t
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment