Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 # == Class: adblockplus::legacy::webserver | 1 # == Class: adblockplus::legacy::webserver |
2 # | 2 # |
3 # A container for migrating obsolete resources in web2, formerly located | 3 # A container for migrating obsolete resources in web2, formerly located |
4 # in manifests/webserver.pp. | 4 # in manifests/webserver.pp. |
5 # | 5 # |
6 # See http://hub.eyeo.com/issues/2007 for more information. | 6 # See http://hub.eyeo.com/issues/2007 for more information. |
7 # | 7 # |
8 class adblockplus::legacy::webserver { | 8 class adblockplus::legacy::webserver { |
9 | |
10 class {'web::server': | |
11 vhost => 'adblockplus.org', | |
12 certificate => 'adblockplus.org_sslcert.pem', | |
13 private_key => 'adblockplus.org_sslcert.key', | |
14 is_default => true, | |
15 aliases => ['www.adblockplus.org'], | |
16 custom_config => template("web/adblockplus.org.conf.erb"), | |
17 repository => 'web.adblockplus.org', | |
18 multiplexer_locations => ['/getSubscription'], | |
19 geoip => true, | |
20 } | |
21 | |
22 ensure_packages([ | |
23 'make', | |
24 'doxygen', | |
25 ]) | |
26 | |
9 $subscription_repo = '/home/www/subscriptionlist' | 27 $subscription_repo = '/home/www/subscriptionlist' |
10 | 28 |
11 $fetch_repo_cmd = [ | 29 $fetch_repo_cmd = [ |
12 'hg', 'clone', | 30 'hg', 'clone', |
13 '--noupdate', | 31 '--noupdate', |
14 'https://hg.adblockplus.org/subscriptionlist', | 32 'https://hg.adblockplus.org/subscriptionlist', |
15 $subscription_repo, | 33 $subscription_repo, |
16 ] | 34 ] |
17 | 35 |
18 exec {'fetch_repository_subscriptionlist': | 36 exec {'fetch_repository_subscriptionlist': |
19 command => shellquote($fetch_repo_cmd), | 37 command => shellquote($fetch_repo_cmd), |
20 path => '/usr/local/bin:/usr/bin:/bin', | 38 path => '/usr/local/bin:/usr/bin:/bin', |
21 user => 'www', | 39 user => 'www', |
22 timeout => 0, | 40 timeout => 0, |
23 onlyif => "test ! -d $subscription_repo", | 41 onlyif => "test ! -d $subscription_repo", |
24 require => Package['mercurial'], | 42 require => Class['web::server'], |
mathias
2017/07/09 07:12:35
One should not reference resources without them be
| |
25 } | 43 } |
26 | 44 |
27 $update_repo_cmd = [ | 45 $update_repo_cmd = [ |
28 'hg', 'pull', | 46 'hg', 'pull', |
29 '--quiet', '--repository', | 47 '--quiet', '--repository', |
30 $subscription_repo, | 48 $subscription_repo, |
31 ] | 49 ] |
32 | 50 |
33 cron {'update_repository_subscriptionlist': | 51 cron {'update_repository_subscriptionlist': |
34 ensure => present, | 52 ensure => present, |
35 environment => hiera('cron::environment', []), | 53 environment => hiera('cron::environment', []), |
36 command => shellquote($update_repo_cmd), | 54 command => shellquote($update_repo_cmd), |
37 user => 'www', | 55 user => 'www', |
38 minute => '1-59/20', | 56 minute => '1-59/20', |
39 require => Exec['fetch_repository_subscriptionlist'] | 57 require => Exec['fetch_repository_subscriptionlist'] |
40 } | 58 } |
41 | 59 |
42 $generate_docs_cmd = [ | 60 $generate_docs_cmd = [ |
43 'python', '-m', | 61 'python', '-m', |
44 'sitescripts.docs.bin.generate_docs', | 62 'sitescripts.docs.bin.generate_docs', |
45 ] | 63 ] |
46 | 64 |
47 cron {'generate_docs': | 65 cron {'generate_docs': |
48 ensure => 'present', | 66 ensure => 'present', |
49 require => [ | 67 require => [ |
mathias
2017/07/09 07:12:35
One should not reference resources without them be
| |
50 Class['sitescripts'], | 68 Class['sitescripts'], |
51 Exec['install_jsdoc'], | 69 Class['web::server'], |
52 Package['make', 'doxygen'], | 70 Class['nodejs'], |
53 File['/var/www/docs'], | |
54 ], | 71 ], |
55 command => shellquote($generate_docs_cmd), | 72 command => shellquote($generate_docs_cmd), |
56 user => www, | 73 user => www, |
57 minute => '5-55/10', | 74 minute => '5-55/10', |
58 } | 75 } |
59 } | 76 } |
60 | 77 |
LEFT | RIGHT |