OLD | NEW |
(Empty) | |
| 1 # == Class: adblockplus::legacy::webserver |
| 2 # |
| 3 # A container for migrating obsolete resources in web2, formerly located |
| 4 # in manifests/webserver.pp. |
| 5 # |
| 6 # See http://hub.eyeo.com/issues/2007 for more information. |
| 7 # |
| 8 class adblockplus::legacy::webserver { |
| 9 $subscription_repo = '/home/www/subscriptionlist' |
| 10 |
| 11 $fetch_repo_cmd = [ |
| 12 'hg', 'clone', |
| 13 '--noupdate', |
| 14 'https://hg.adblockplus.org/subscriptionlist', |
| 15 $subscription_repo, |
| 16 ] |
| 17 |
| 18 exec {'fetch_repository_subscriptionlist': |
| 19 command => shellquote($fetch_repo_cmd), |
| 20 path => '/usr/local/bin:/usr/bin:/bin', |
| 21 user => 'www', |
| 22 timeout => 0, |
| 23 onlyif => "test ! -d $subscription_repo", |
| 24 require => Class['web::server'], |
| 25 } |
| 26 |
| 27 $update_repo_cmd = [ |
| 28 'hg', 'pull', |
| 29 '--quiet', '--repository', |
| 30 $subscription_repo, |
| 31 ] |
| 32 |
| 33 cron {'update_repository_subscriptionlist': |
| 34 ensure => present, |
| 35 environment => hiera('cron::environment', []), |
| 36 command => shellquote($update_repo_cmd), |
| 37 user => 'www', |
| 38 minute => '1-59/20', |
| 39 require => Exec['fetch_repository_subscriptionlist'] |
| 40 } |
| 41 |
| 42 $generate_docs_cmd = [ |
| 43 'python', '-m', |
| 44 'sitescripts.docs.bin.generate_docs', |
| 45 ] |
| 46 |
| 47 cron {'generate_docs': |
| 48 ensure => 'present', |
| 49 require => [ |
| 50 Class['sitescripts'], |
| 51 Class['web::server'], |
| 52 Class['nodejs'], |
| 53 ], |
| 54 command => shellquote($generate_docs_cmd), |
| 55 user => www, |
| 56 minute => '5-55/10', |
| 57 } |
| 58 } |
| 59 |
OLD | NEW |