Skip to content

Instantly share code, notes, and snippets.

@mfox
Last active June 20, 2017 02:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mfox/2640568 to your computer and use it in GitHub Desktop.
Save mfox/2640568 to your computer and use it in GitHub Desktop.
Quickly install Puppet from source + dependencies
#!/bin/bash
# Quick and easy script to install Puppet, Facter and dependencies.
# Kickstarts a node ready for puppeting.
# Tested with:
#
# - Scientific Linux 6.1, 6.2, 6.3
# - CentOS 6.3
FACTER_TGZ="http://downloads.puppetlabs.com/facter/facter-1.7.6.tar.gz"
PUPPET_TGZ="http://downloads.puppetlabs.com/puppet/puppet-2.7.26.tar.gz"
## Installing Ruby
echo "Installing Ruby.."
yum -y -e 0 -d 0 install ruby ruby-devel rubygems libselinux-ruby gcc make
gem install -r -v 2.4.1 ruby-shadow
echo "Downloading Facter.."
curl -s -O ${FACTER_TGZ}
echo "Downloading Puppet.."
curl -s -O ${PUPPET_TGZ}
id puppet 2>1 1>/dev/null
if [[ $? == 1 ]]; then
adduser -r puppet
fi
## Install Facter
echo "Installing Facter.."
tar xzf facter-1.7.6.tar.gz
rm -f facter-1.7.6.tar.gz
pushd facter*
ruby ./install.rb 1>/dev/null
popd
## Install Puppet
echo "Installing Puppet.."
tar xzf puppet-2.7.26.tar.gz
rm -f puppet-2.7.26.tar.gz
pushd puppet*
ruby ./install.rb 1>/dev/null
cp conf/redhat/client.init /etc/init.d/puppet && chmod +x /etc/init.d/puppet
cp conf/redhat/client.sysconfig /etc/sysconfig/puppet
cp conf/redhat/logrotate /etc/logrotate.d/puppetmaster
cp conf/redhat/puppet.conf /etc/puppet/
chkconfig --add puppet
chkconfig puppet on
popd
echo "
* 1. Configure your Puppet Master in puppet.conf:
[agent]
server = puppet-master.yourdomain.co.nz
* 2. Run:
puppet agent -v --test --waitforcert 60
..to send a signing request to the Puppet Master.
"
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment