Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: modules/adblockplus/manifests/legacy/webserver.pp

Issue 29483575: #2007 - Create abp::legacy::webserver class for hiera compatibility (Closed)
Patch Set: Creates a full commit for refactoring webserver manifest Created July 10, 2017, 6:29 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
(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
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 $subscription_repo = '/home/www/subscriptionlist'
23
24 $fetch_repo_cmd = [
25 'hg', 'clone',
26 '--noupdate',
27 'https://hg.adblockplus.org/subscriptionlist',
28 $subscription_repo,
29 ]
30
31 exec {'fetch_repository_subscriptionlist':
32 command => shellquote($fetch_repo_cmd),
33 path => '/usr/local/bin:/usr/bin:/bin',
34 user => 'www',
35 timeout => 0,
36 onlyif => "test ! -d $subscription_repo",
37 require => Class['web::server'],
38 }
39
40 $update_repo_cmd = [
41 'hg', 'pull',
42 '--quiet', '--repository',
43 $subscription_repo,
44 ]
45
46 cron {'update_repository_subscriptionlist':
47 ensure => present,
48 environment => hiera('cron::environment', []),
49 command => shellquote($update_repo_cmd),
50 user => 'www',
51 minute => '1-59/20',
52 require => Exec['fetch_repository_subscriptionlist']
53 }
54
55 $generate_docs_cmd = [
56 'python', '-m',
57 'sitescripts.docs.bin.generate_docs',
58 ]
59
60 cron {'generate_docs':
61 ensure => 'present',
62 require => [
63 Class['sitescripts'],
64 Class['web::server'],
65 Class['nodejs'],
66 ],
67 command => shellquote($generate_docs_cmd),
68 user => www,
69 minute => '5-55/10',
70 }
71 }
72
OLDNEW

Powered by Google App Engine
This is Rietveld