Updates install_jenkins_slave.sh to support RHEL.

Add support configuring Red Hat 6 jenkins slaves:

-installs EPEL
-installs puppet 2.7 (from puppetlabs repo)
-installs git

Tested on Red Hat 6.1 and 6.4.

Change-Id: Ib5808ea6356ebaa271170f68b78a431f2d68d995
Reviewed-on: https://review.openstack.org/18907
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
This commit is contained in:
Dan Prince 2013-01-03 13:48:37 -05:00 committed by Jenkins
parent f2058ced8e
commit 019ba4f928

View File

@ -5,19 +5,42 @@ if [[ $EUID -ne 0 ]]; then
exit 1
fi
cat > /etc/apt/preferences.d/00-puppet.pref <<EOF
Package: puppet puppet-common puppetmaster puppetmaster-common
Pin: version 2.7*
Pin-Priority: 501
EOF
if cat /etc/*release | grep "Red Hat" &> /dev/null; then
lsbdistcodename=`lsb_release -c -s`
puppet_deb=puppetlabs-release-${lsbdistcodename}.deb
wget http://apt.puppetlabs.com/$puppet_deb -O $puppet_deb
dpkg -i $puppet_deb
rpm -qi epel-release &> /dev/null || rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
#installing this package gives use the key
rpm -ivh http://yum.puppetlabs.com/el/6/products/x86_64/puppetlabs-release-6-6.noarch.rpm
cat > /etc/yum.repos.d/puppetlabs.repo <<-"EOF"
[puppetlabs-products]
name=Puppet Labs Products El 6 - $basearch
baseurl=http://yum.puppetlabs.com/el/6/products/$basearch
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puppetlabs
enabled=1
gpgcheck=1
exclude=puppet-2.8* puppet-2.9* puppet-3*
EOF
yum update -y
# NOTE: enable the optional-rpms channel (if not already enabled)
# yum-config-manager --enable rhel-6-server-optional-rpms
yum install -y git puppet
apt-get update
apt-get install -y puppet git rubygems
else #defaults to Ubuntu
cat > /etc/apt/preferences.d/00-puppet.pref <<-EOF
Package: puppet puppet-common puppetmaster puppetmaster-common
Pin: version 2.7*
Pin-Priority: 501
EOF
lsbdistcodename=`lsb_release -c -s`
puppet_deb=puppetlabs-release-${lsbdistcodename}.deb
wget http://apt.puppetlabs.com/$puppet_deb -O $puppet_deb
dpkg -i $puppet_deb
apt-get update
apt-get install -y puppet git rubygems
fi
git clone https://github.com/openstack-infra/config
bash config/install_modules.sh