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

Side by Side Diff: manifests/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 node 'web2' {
2
3 class {'web::server':
4 vhost => 'adblockplus.org',
5 certificate => 'adblockplus.org_sslcert.pem',
6 private_key => 'adblockplus.org_sslcert.key',
7 is_default => true,
8 aliases => ['www.adblockplus.org'],
9 custom_config => template('web/adblockplus.org.conf.erb'),
10 repository => 'web.adblockplus.org',
11 multiplexer_locations => ['/getSubscription'],
12 geoip => true,
13 }
14
15 $sitescripts_var_dir = '/var/lib/sitescripts'
16 $subscriptions_repo = "${sitescripts_var_dir}/subscriptionlist"
17
18 concat::fragment {'formmail_template':
19 target => '/etc/sitescripts.ini',
20 content => "
21 [multiplexer]
22 sitescripts.subscriptions.web.fallback =
23 [subscriptions]
24 repository=$sitescripts_var_dir/subscriptionlist",
25 }
26
27 user {'sitescripts':
28 ensure => present,
29 home => $sitescripts_var_dir
30 }
31
32 file {$sitescripts_var_dir:
33 ensure => directory,
34 mode => 0755,
35 owner => 'sitescripts',
36 group => 'sitescripts'
37 }
38
39 exec {'fetch_repository_subscriptionlist':
40 command => "hg clone --noupdate https://hg.adblockplus.org/subscriptionlist $subscriptions_repo",
41 path => '/usr/local/bin:/usr/bin:/bin',
42 user => 'sitescripts',
43 timeout => 0,
44 onlyif => "test ! -d $subscriptions_repo",
45 require => [Package['mercurial'], File[$sitescripts_var_dir]]
46 }
47
48 cron {'update_repository_subscriptionlist':
49 ensure => present,
50 environment => hiera('cron::environment', []),
51 command => "hg pull --quiet --repository $subscriptions_repo",
52 user => 'sitescripts',
53 minute => '1-59/20',
54 require => Exec['fetch_repository_subscriptionlist']
55 }
56
57 # We have to set up the APT source and install the jsdoc package via npm
58 # manually. Once we're on Puppet 3, we can use the official nodejs module for
59 # all this: https://forge.puppetlabs.com/puppetlabs/nodejs
60
61 apt::source {'nodesource':
62 location => 'https://deb.nodesource.com/node_4.x',
63 release => 'precise',
64 repos => 'main',
65 key => '68576280',
66 key_content => template('web/nodesource.gpg.key.erb'),
67 }
68
69 package {'nodejs':
70 require => Apt::Source['nodesource'],
71 }
72
73 exec {'install_jsdoc':
74 command => 'npm install --global jsdoc',
75 path => ['/usr/bin/'],
76 require => Package['nodejs'],
77 onlyif => 'test ! -x /usr/bin/jsdoc',
78 }
79
80 package {['make', 'doxygen']:}
81
82 cron {'generate_docs':
83 ensure => 'present',
84 require => [
85 Class['sitescripts'],
86 Exec['install_jsdoc'],
87 Package['make', 'doxygen'],
88 File['/var/www/docs'],
89 ],
90 command => 'python -m sitescripts.docs.bin.generate_docs',
91 user => www,
92 minute => '5-55/10',
93 }
94
95 adblockplus::log::rotation {'nginx_email_submission':
96 count => 120,
97 ensure => 'present',
98 interval => 'monthly',
99 path => '/var/log/nginx/email_submission',
100 }
101 }
OLDNEW

Powered by Google App Engine
This is Rietveld