summaryrefslogtreecommitdiff
path: root/files/update-puppet-conf.sh
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2009-12-30 15:42:55 -0200
committerSilvio Rhatto <rhatto@riseup.net>2009-12-30 15:42:55 -0200
commit5c73c32c08f22cc57eb48812591e119fbb14b457 (patch)
tree593203121f646ca91166dcd27781177e1a3d167f /files/update-puppet-conf.sh
downloadpuppet-puppet-5c73c32c08f22cc57eb48812591e119fbb14b457.tar.gz
puppet-puppet-5c73c32c08f22cc57eb48812591e119fbb14b457.tar.bz2
Initial import
Diffstat (limited to 'files/update-puppet-conf.sh')
-rw-r--r--files/update-puppet-conf.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/files/update-puppet-conf.sh b/files/update-puppet-conf.sh
new file mode 100644
index 0000000..e850c47
--- /dev/null
+++ b/files/update-puppet-conf.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+# This file updates the /etc/puppet directory with recent changes to the
+# /var/git/repositories/puppet repository and changes to other remote
+# repositories configured as submodules of this puppet installation. This
+# script it intended to be called from a cron-job.
+
+PUPPET_DIR=/etc/puppet
+ORIGIN_DIR=/var/git/repositories/puppet.git
+
+unset GIT_DIR
+
+cd ${PUPPET_DIR}
+git pull ${ORIGIN_DIR} master
+git checkout -f
+git submodule update --init
+for module in `git submodule | cut -d" " -f3`; do
+ cd ${PUPPET_DIR}/${module}
+ git pull origin master
+done
+git clean -d -f