aboutsummaryrefslogtreecommitdiffstats
path: root/modules/git/manifests/mirror.pp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/git/manifests/mirror.pp')
-rw-r--r--modules/git/manifests/mirror.pp19
1 files changed, 19 insertions, 0 deletions
diff --git a/modules/git/manifests/mirror.pp b/modules/git/manifests/mirror.pp
new file mode 100644
index 00000000..1700380a
--- /dev/null
+++ b/modules/git/manifests/mirror.pp
@@ -0,0 +1,19 @@
+define git::mirror( $source,
+ $description,
+ $refresh = '*/5') {
+
+ exec { "/usr/bin/git clone --bare $source $name":
+ alias => "git mirror $name",
+ creates => $name,
+ before => File["$name/description"],
+ }
+
+ file { "$name/description":
+ content => $description,
+ }
+
+ cron { "update $name":
+ command => "cd $name ; /usr/bin/git fetch -q",
+ minute => $refresh
+ }
+}