Merge pull request #64 from jblaine/master

Support for RHEL
This commit is contained in:
R. Tyler Croy 2012-12-12 09:43:44 -08:00
commit ee0b8aea3e
1 changed files with 47 additions and 24 deletions

View File

@ -1,18 +1,26 @@
#!/bin/sh -x
OSNAME=`uname`
LINUXFLAVOR=`lsb_release -is`
PROG=`basename $0`
Info () {
echo "$PROG : $*"
}
Fatal () {
echo "$PROG : FATAL: $*"
exit 1
}
Info "Begin"
if [ "${OSNAME}" = "FreeBSD" ]; then
which pkg > /dev/null
which pkg > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "pkgng is not installed!"
Info "pkgng is not installed!"
ftp -V ftp://anonymous:ec2@ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9-stable/Latest/pkg.tbz
pkg_add ./pkg.tbz
echo "PACKAGESITE : http://pkgbeta.freebsd.org/freebsd-9-amd64/latest/" > /usr/local/etc/pkg.conf
pkg update -q
# Update pkgng itself
pkg install -y pkg
@ -20,23 +28,38 @@ if [ "${OSNAME}" = "FreeBSD" ]; then
pkg install -y rsync
# Install puppet so we can get that up and running
pkg install -y puppet
fi;
else
export PATH=/var/lib/gems/1.8/bin:/usr/local/bin:$PATH
which puppet
if [ $? -ne 0 ]; then
apt-get update
apt-get install -y ruby1.8 \
ruby1.8-dev \
libopenssl-ruby1.8 \
rubygems
gem install puppet --version "~> 2.7" --no-ri --no-rdoc
fi
else
case "$LINUXFLAVOR" in
RedHat*) # Extract the major version number
VERSION=`lsb_release -ids | sed 's/.*release \([0-9]\).*/\1/'`
if [ $VERSION -eq 5 ]; then
rpm -ivh http://yum.puppetlabs.com/el/5/products/i386/puppetlabs-release-5-6.noarch.rpm
elif [ $VERSION -eq 6 ]; then
rpm -ivh http://yum.puppetlabs.com/el/6/products/i386/puppetlabs-release-6-6.noarch.rpm
else
Fatal "Unsupported Red Hat release: $VERSION"
fi
# Disable EPEL if for some reason it is configured on this host
# as we don't want to get some old Puppet from there.
if [ -f /etc/yum.repos.d/epel.repo ]; then
yum install -y puppet --disablerepo=epel
else
yum install -y puppet
fi
;;
Ubuntu) export PATH=/var/lib/gems/1.8/bin:/usr/local/bin:$PATH
which puppet > /dev/null 2>&1
if [ $? -ne 0 ]; then
apt-get update
apt-get install -y ruby1.8 \
ruby1.8-dev \
libopenssl-ruby1.8 \
rubygems
gem install puppet --version "~> 2.7" --no-ri --no-rdoc
fi
;;
*) Fatal "Unsupported Linux flavor: $LINUXFLAVOR"
;;
esac
fi