Index: modules/filtermaster/manifests/repo_download.pp |
diff --git a/modules/filtermaster/manifests/repo_download.pp b/modules/filtermaster/manifests/repo_download.pp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..7a7f8f4e01647f196fbdc102720a04a61173cfbe |
--- /dev/null |
+++ b/modules/filtermaster/manifests/repo_download.pp |
@@ -0,0 +1,35 @@ |
+# == Type: filtermaster::repo_download |
+# |
+# Manage filter list download source repositories for aggregation. |
+# |
+# === Parameters: |
+# |
+# [*alias*] |
+# An optional alias for use as the download resource name, allows for |
+# repositories with different names. Note that this option is recognized |
+# only when setup via hiera('filtermaster::repo_downloads')! |
+# |
+# === Examples: |
+# |
+# filtermaster::repo_download {'exceptionrules': |
+# alias => 'exceptions', |
+# } |
+# |
+define filtermaster::repo_download ( |
+ $alias = $title, |
+) { |
+ |
+ $directory = "/home/rsync/subscription/$title" |
+ $repository = "https://hg.adblockplus.org/$title" |
mathias
2015/10/12 10:00:22
IMHO $name would be a better fit here, but the doc
|
+ |
+ ensure_packages(['mercurial']) |
+ |
+ exec {"fetch_${title}": |
mathias
2015/10/12 10:00:22
Maybe we should rename this part to be more verbos
|
+ command => shellquote('hg', 'clone', $repository, $directory), |
+ onlyif => shellquote('test', '!', '-d', $directory), |
+ path => ['/usr/local/bin', '/usr/bin', '/bin'], |
+ require => Package['mercurial'], |
+ timeout => 0, |
+ user => rsync, |
+ } |
+} |