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..fa08fb2f87f51b70d4dd0a9826f173bf4fdb8119 |
--- /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" |
+ |
+ ensure_packages(['mercurial']) |
+ |
+ exec {"filtermaster::repo_download#$title": |
+ 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', |
+ } |
+} |