summaryrefslogtreecommitdiff
path: root/files/post-update.sh
blob: a484b34c09f609928cac330c6093ebc7a2596774 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
# See https://we.riseup.net/riseup+tech/puppet
#
# Alternatives: https://github.com/pdxcat/puppet-sync
#               https://github.com/theforeman/puppet-puppet/blob/master/templates/server/post-receive.erb

echo ""
echo "Updating puppet configuration..."
echo ""

unset GIT_DIR

cd $PUPPET_DIR

# lockfile comes from procmail package
lockfile ~/puppet.lock

# call external SUID script that will update PUPPET_DIR
sudo -u puppet /usr/local/sbin/update-puppet-conf.sh || echo "Updating puppet failed. Fix it manually."

# remove lock
rm -f ~/puppet.lock