OLD | NEW |
(Empty) | |
| 1 define adblockplus::sitescripts::repository ( |
| 2 $location = "/opt/$name", |
| 3 $source = "https://hg.adblockplus.org/$name", |
| 4 ) { |
| 5 |
| 6 ensure_packages([ |
| 7 'python', |
| 8 'python-flup', |
| 9 ]) |
| 10 |
| 11 $ensure_dependencies_command = shellquote([ |
| 12 'python', '--', "$location/ensure_dependencies.py", '-q' |
| 13 ]) |
| 14 |
| 15 $fetch_command = join([ |
| 16 shellquote(['hg', 'clone', $source, $location]), |
| 17 $ensure_dependencies_command, |
| 18 ], ' && ') |
| 19 |
| 20 exec { "fetch_$name": |
| 21 command => shellquote(['hg', 'clone', $source, $location]), |
| 22 creates => $location, |
| 23 path => ['/usr/bin/', '/bin/'], |
| 24 require => Package['mercurial'], |
| 25 } |
| 26 |
| 27 Exec["fetch_$name"] <- Package['mercurial'] |
| 28 Exec["fetch_$name"] <- Package['python'] |
| 29 |
| 30 $update_command = join([ |
| 31 shellquote(['hg', 'pull', '-q', '-u', '-R', $location]), |
| 32 $ensure_dependencies_command, |
| 33 ], ' && ') |
| 34 |
| 35 cron {"update_$name": |
| 36 ensure => 'present', |
| 37 command => $update_command, |
| 38 environment => hiera('cron::environment', []), |
| 39 user => 'root', |
| 40 minute => [15], |
| 41 } |
| 42 |
| 43 Cron["update_$name"] <- Exec["fetch_$name"] |
| 44 } |
OLD | NEW |