| Index: modules/notificationserver/manifests/init.pp |
| =================================================================== |
| --- a/modules/notificationserver/manifests/init.pp |
| +++ b/modules/notificationserver/manifests/init.pp |
| @@ -7,46 +7,35 @@ |
| } |
| } |
| - if !defined(File['/var/www']) { |
| - file {'/var/www': |
| - ensure => directory, |
| - owner => nginx, |
| - mode => 0755, |
| - require => Package['nginx'] |
| - } |
| - } |
| - |
| class {'sitescripts': |
| sitescriptsini_source => 'puppet:///modules/notificationserver/sitescripts.ini' |
| } |
| - file {'/var/www/notification': |
| - ensure => directory, |
| - owner => nginx, |
| - mode => 0755, |
| - require => Package['nginx'] |
| - } |
| - |
| - exec { "fetch_notifications": |
| - command => "hg clone --noupdate https://hg.adblockplus.org/notifications /opt/notifications && chown -R nginx /opt/notifications", |
| - path => ["/usr/bin/", "/bin/"], |
| + exec {'fetch_notifications': |
| + command => 'hg clone --noupdate https://hg.adblockplus.org/notifications /opt/notifications && chown -R nginx /opt/notifications', |
| + path => ['/usr/bin/', '/bin/'], |
| require => [ |
| Package['mercurial'], |
| Package['nginx'], |
| ], |
| - onlyif => "test ! -d /opt/notifications" |
| + onlyif => 'test ! -d /opt/notifications' |
| } |
| - cron {"update_notifications": |
| + include spawn-fcgi |
| + package {'python-flup':} |
|
mathias
2015/04/14 05:12:20
OK for now, but please see https://issues.adblockp
|
| + |
| + spawn-fcgi::pool {'multiplexer': |
| ensure => present, |
| - command => "python -m sitescripts.management.bin.generateNotifications", |
| - environment => ['MAILTO=admins@adblockplus.org,root', 'PYTHONPATH=/opt/sitescripts'], |
| - user => nginx, |
| - minute => '*/10', |
| + fcgi_app => '/opt/sitescripts/multiplexer.fcgi', |
| + socket => '/tmp/multiplexer-fastcgi.sock', |
| + mode => '0666', |
| + user => 'nginx', |
| + children => 1, |
| require => [ |
| - Exec["fetch_notifications"], |
| - Exec["fetch_sitescripts"] |
| - ], |
| + Exec['fetch_sitescripts'], |
| + Exec['fetch_notifications'], |
| + Package['python-flup'] |
| + ] |
| } |
| File { |
| @@ -57,6 +46,7 @@ |
| nginx::hostconfig{'notification.adblockplus.org': |
| source => 'puppet:///modules/notificationserver/site.conf', |
| + 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
|
| is_default => $is_default, |
| certificate => 'easylist-downloads.adblockplus.org_sslcert.pem', |
| private_key => 'easylist-downloads.adblockplus.org_sslcert.key', |