Left: | ||
Right: |
OLD | NEW |
---|---|
1 class notificationserver($is_default = false) { | 1 class notificationserver($is_default = false) { |
2 if !defined(Class['nginx']) { | 2 if !defined(Class['nginx']) { |
3 class {'nginx': | 3 class {'nginx': |
4 worker_processes => 2, | 4 worker_processes => 2, |
5 worker_connections => 4000, | 5 worker_connections => 4000, |
6 ssl_session_cache => off, | 6 ssl_session_cache => off, |
7 } | 7 } |
8 } | 8 } |
9 | 9 |
10 if !defined(File['/var/www']) { | |
11 file {'/var/www': | |
12 ensure => directory, | |
13 owner => nginx, | |
14 mode => 0755, | |
15 require => Package['nginx'] | |
16 } | |
17 } | |
18 | |
19 class {'sitescripts': | 10 class {'sitescripts': |
20 sitescriptsini_source => 'puppet:///modules/notificationserver/sitescripts.i ni' | 11 sitescriptsini_source => 'puppet:///modules/notificationserver/sitescripts.i ni' |
21 } | 12 } |
22 | 13 |
23 file {'/var/www/notification': | 14 exec {'fetch_notifications': |
24 ensure => directory, | 15 command => 'hg clone --noupdate https://hg.adblockplus.org/notifications /op t/notifications && chown -R nginx /opt/notifications', |
25 owner => nginx, | 16 path => ['/usr/bin/', '/bin/'], |
26 mode => 0755, | |
27 require => Package['nginx'] | |
28 } | |
29 | |
30 exec { "fetch_notifications": | |
31 command => "hg clone --noupdate https://hg.adblockplus.org/notifications /op t/notifications && chown -R nginx /opt/notifications", | |
32 path => ["/usr/bin/", "/bin/"], | |
33 require => [ | 17 require => [ |
34 Package['mercurial'], | 18 Package['mercurial'], |
35 Package['nginx'], | 19 Package['nginx'], |
36 ], | 20 ], |
37 onlyif => "test ! -d /opt/notifications" | 21 onlyif => 'test ! -d /opt/notifications' |
38 } | 22 } |
39 | 23 |
40 cron {"update_notifications": | 24 include spawn-fcgi |
25 package {'python-flup':} | |
mathias
2015/04/14 05:12:20
OK for now, but please see https://issues.adblockp
| |
26 | |
27 spawn-fcgi::pool {'multiplexer': | |
41 ensure => present, | 28 ensure => present, |
42 command => "python -m sitescripts.management.bin.generateNotifications", | 29 fcgi_app => '/opt/sitescripts/multiplexer.fcgi', |
43 environment => ['MAILTO=admins@adblockplus.org,root', 'PYTHONPATH=/opt/sites cripts'], | 30 socket => '/tmp/multiplexer-fastcgi.sock', |
44 user => nginx, | 31 mode => '0666', |
45 minute => '*/10', | 32 user => 'nginx', |
33 children => 1, | |
46 require => [ | 34 require => [ |
47 Exec["fetch_notifications"], | 35 Exec['fetch_sitescripts'], |
48 Exec["fetch_sitescripts"] | 36 Exec['fetch_notifications'], |
49 ], | 37 Package['python-flup'] |
38 ] | |
50 } | 39 } |
51 | 40 |
52 File { | 41 File { |
53 owner => root, | 42 owner => root, |
54 group => root, | 43 group => root, |
55 mode => 0644, | 44 mode => 0644, |
56 } | 45 } |
57 | 46 |
58 nginx::hostconfig{'notification.adblockplus.org': | 47 nginx::hostconfig{'notification.adblockplus.org': |
59 source => 'puppet:///modules/notificationserver/site.conf', | 48 source => 'puppet:///modules/notificationserver/site.conf', |
49 global_config => template('notificationserver/global.conf.erb'), | |
Felix Dahlke
2015/04/12 23:05:11
I don't actually need a template here, but it look
mathias
2015/04/14 05:12:20
Indeed, we've used template() before in such cases
| |
60 is_default => $is_default, | 50 is_default => $is_default, |
61 certificate => 'easylist-downloads.adblockplus.org_sslcert.pem', | 51 certificate => 'easylist-downloads.adblockplus.org_sslcert.pem', |
62 private_key => 'easylist-downloads.adblockplus.org_sslcert.key', | 52 private_key => 'easylist-downloads.adblockplus.org_sslcert.key', |
63 log => 'access_log_notification' | 53 log => 'access_log_notification' |
64 } | 54 } |
65 } | 55 } |
OLD | NEW |