2014-12-15 18:00:01 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
if which puppet >/dev/null 2>&1; then
|
2015-07-20 16:48:40 +02:00
|
|
|
exit 0
|
2014-12-15 18:00:01 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
RELEASEVER=$(rpm -q --qf "%{VERSION}" $(rpm -q --whatprovides redhat-release))
|
|
|
|
|
|
|
|
case $RELEASEVER in
|
|
|
|
6|7)
|
|
|
|
PUPPET="http://yum.puppetlabs.com/puppetlabs-release-el-${RELEASEVER}.noarch.rpm"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Unknown release version: $RELEASEVER" >&2
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
echo "Adding puppet repository.."
|
|
|
|
rpm --import "https://yum.puppetlabs.com/RPM-GPG-KEY-puppetlabs"
|
2015-07-20 16:48:40 +02:00
|
|
|
rpm -Uvh $PUPPET >/dev/null
|
2014-12-15 18:00:01 +01:00
|
|
|
|
|
|
|
echo "Installing puppet.."
|
|
|
|
yum install -y puppet >/dev/null
|