Index: modules/downloadserver/manifests/init.pp |
=================================================================== |
--- a/modules/downloadserver/manifests/init.pp |
+++ b/modules/downloadserver/manifests/init.pp |
@@ -39,13 +39,23 @@ |
managehome => true |
} |
+ file { '/var/www/downloads': |
+ ensure => 'directory', |
+ mode => '0755', |
+ group => 'hg', |
+ owner => 'hg', |
+ } |
+ |
exec { "fetch_downloads": |
command => "hg clone https://hg.adblockplus.org/downloads /var/www/downloads", |
path => ["/usr/bin/", "/bin/"], |
- require => Package['mercurial'], |
user => hg, |
+ require => [ |
+ Package['mercurial'], |
+ File['/var/www/downloads'], |
+ ], |
timeout => 0, |
- onlyif => "test ! -d /var/www/downloads" |
+ creates => "/var/www/downloads/.hg/hgrc" |
} |
File { |
@@ -76,6 +86,10 @@ |
minute => '3-59/20' |
} |
+ ensure_packages([ |
+ 'rsync', |
+ ]) |
+ |
file {'/var/www/devbuilds': |
ensure => directory, |
owner => rsync |
@@ -110,8 +124,11 @@ |
cron {'mirror-devbuilds': |
ensure => present, |
- require => [File['/home/rsync/.ssh/id_rsa'], |
- File['/var/www/devbuilds']], |
+ require => [ |
+ File['/home/rsync/.ssh/id_rsa'], |
+ File['/var/www/devbuilds'], |
+ Package['rsync'], |
+ ], |
command => 'rsync -e ssh -ltprz --delete devbuilds@buildmaster.adblockplus.org:. /var/www/devbuilds', |
environment => hiera('cron::environment', []), |
user => rsync, |