OLD | NEW |
1 # == Type: filtermaster::repo_download | 1 # == Type: filtermaster::repo_download |
2 # | 2 # |
3 # Manage filter list download source repositories for aggregation. | 3 # Manage filter list download source repositories for aggregation. |
4 # | 4 # |
5 # === Parameters: | 5 # === Parameters: |
6 # | 6 # |
7 # [*target*] | 7 # [*target*] |
8 # An optional alias for use as the download resource name, allows for | 8 # An optional alias for use as the download resource name, allows for |
9 # repositories with different names. Note that this option is recognized | 9 # repositories with different names. Note that this option is recognized |
10 # only when setup via hiera('filtermaster::repo_downloads')! | 10 # only when setup via hiera('filtermaster::repo_downloads')! |
(...skipping 10 matching lines...) Expand all Loading... |
21 # } | 21 # } |
22 # | 22 # |
23 define filtermaster::repo_download ( | 23 define filtermaster::repo_download ( |
24 $target = $title, | 24 $target = $title, |
25 $static_files = [], | 25 $static_files = [], |
26 ) { | 26 ) { |
27 | 27 |
28 $directory = "/home/rsync/subscription/$title" | 28 $directory = "/home/rsync/subscription/$title" |
29 $repository = "https://hg.adblockplus.org/$title" | 29 $repository = "https://hg.adblockplus.org/$title" |
30 | 30 |
31 ensure_packages(['mercurial']) | |
32 | |
33 exec {"filtermaster::repo_download#$title": | 31 exec {"filtermaster::repo_download#$title": |
34 command => shellquote('hg', 'clone', $repository, $directory), | 32 command => shellquote('hg', 'clone', $repository, $directory), |
35 onlyif => shellquote('test', '!', '-d', $directory), | 33 onlyif => shellquote('test', '!', '-d', $directory), |
36 path => ['/usr/local/bin', '/usr/bin', '/bin'], | 34 path => ['/usr/local/bin', '/usr/bin', '/bin'], |
37 require => Package['mercurial'], | 35 require => Package['mercurial'], |
38 timeout => 0, | 36 timeout => 0, |
39 user => 'rsync', | 37 user => 'rsync', |
40 } | 38 } |
41 | 39 |
42 file {"$directory/.hg/hgrc": | 40 file {"$directory/.hg/hgrc": |
43 content => template('filtermaster/hgrc.erb'), | 41 content => template('filtermaster/hgrc.erb'), |
44 owner => 'rsync', | 42 owner => 'rsync', |
45 require => Exec["filtermaster::repo_download#$title"], | 43 require => Exec["filtermaster::repo_download#$title"], |
46 } | 44 } |
47 } | 45 } |
OLD | NEW |