summaryrefslogtreecommitdiff
path: root/global/pre-tasks.d/030puppet
blob: cdc99892be516e3bbbc94500aace6bbe9b78504c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/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}'`
    wget -c http://apt.puppetlabs.com/puppetlabs-release-${codename}.deb
    dpkg -i puppetlabs-release-${codename}.deb
    rm -f puppetlabs-release-${codename}.deb*
    apt-get update
    apt-get -y install puppet-common

    mkdir -p `dirname $stamp`
    touch $stamp
fi