-
-
Save moutons/3812053 to your computer and use it in GitHub Desktop.
Quickly install Puppet from source + dependencies
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 | |
## Installing Ruby | |
echo "Installing Ruby.." | |
yum -y -e 0 -d 0 install ruby ruby-devel rubygems libselinux-ruby gcc make | |
gem install -r ruby-shadow | |
echo "Downloading Facter.." | |
curl -s -O http://downloads.puppetlabs.com/facter/facter-latest.tgz | |
echo "Downloading Puppet.." | |
curl -s -O http://downloads.puppetlabs.com/puppet/puppet-latest.tar.gz | |
id puppet 2>1 1>/dev/null | |
if [[ $? == 1 ]]; then | |
adduser -r puppet | |
fi | |
## Install Facter | |
echo "Installing Facter.." | |
tar xzf facter-latest.tgz | |
rm -f facter-latest.tgz | |
pushd facter* | |
ruby ./install.rb 1>/dev/null | |
popd | |
## Install Puppet | |
echo "Installing Puppet.." | |
tar xzf puppet-latest.tar.gz | |
rm -f puppet-latest.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 " | |
* PRO TIP #1: Configure your Puppet Master in puppet.conf: | |
[agent] | |
server = puppet-master.yourdomain.co.nz | |
* PRO TIP #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