eid-ops/global/pre-tasks.d/030puppet

26 lines
844 B
Bash
Executable file

#!/bin/sh
#
# Re-used example from SJD
#
set -e
stamp="$COSMOS_BASE/stamps/puppet-tools-v01.stamp"
if ! test -f $stamp -a -f /usr/bin/puppet; then
#codename=`lsb_release -c| awk '{print $2}'`
#puppetdeb="$COSMOS_REPO/apt/puppetlabs-release-${codename}.deb"
#if [ ! -f $puppetdeb ]; then
# echo "$0: Puppet deb for release $codename not found in $COSMOS_REPO/apt/"
# echo " Get it from https://apt.puppetlabs.com/ and put it in the Cosmos repo."
# exit 1
#fi
## The key currently in use does not appear to actually be installed with $puppetdeb
#test -f apt-key add $COSMOS_REPO/apt/keys/puppetlabs-EF8D349F.pub && apt-key add $COSMOS_REPO/apt/keys/puppetlabs-EF8D349F.pub
#dpkg -i $puppetdeb
apt-get update
apt-get -y install puppet-common
mkdir -p `dirname $stamp`
touch $stamp
fi