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.pp20
1 files changed, 20 insertions, 0 deletions
diff --git a/modules/git/manifests/mirror.pp b/modules/git/manifests/mirror.pp
new file mode 100644
index 00000000..f7364846
--- /dev/null
+++ b/modules/git/manifests/mirror.pp
@@ -0,0 +1,20 @@
+define git::mirror( $source,
+ $description,
+ $refresh = '*/5') {
+
+ include git::common
+ exec { "/usr/bin/git clone --mirror ${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
+ }
+}