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

Side by Side Diff: modules/notificationserver/manifests/init.pp

Issue 29323423: Issue 2869 - Setup cron-job to update notifications (Closed)
Patch Set: Issue 2869 - Fix requirement declaration for Cron[update_notifications] Created Aug. 10, 2015, 11:59 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 class {'sitescripts': 10 class {'sitescripts':
11 sitescriptsini_source => 'puppet:///modules/notificationserver/sitescripts.i ni' 11 sitescriptsini_source => 'puppet:///modules/notificationserver/sitescripts.i ni'
12 } 12 }
13 13
14 exec {'fetch_notifications': 14 exec {'fetch_notifications':
15 command => 'hg clone --noupdate https://hg.adblockplus.org/notifications /op t/notifications && chown -R nginx /opt/notifications', 15 command => 'hg clone --noupdate https://hg.adblockplus.org/notifications /op t/notifications && chown -R nginx /opt/notifications',
16 path => ['/usr/bin/', '/bin/'], 16 path => ['/usr/bin/', '/bin/'],
17 require => [ 17 require => [
18 Package['mercurial'], 18 Package['mercurial'],
19 Package['nginx'], 19 Package['nginx'],
20 ], 20 ],
21 onlyif => 'test ! -d /opt/notifications' 21 onlyif => 'test ! -d /opt/notifications'
22 } 22 }
23 23
24 cron {'update_notifications':
25 command => 'hg pull -q -u -R /opt/notifications',
26 environment => ['MAILTO=admins@adblockplus.org,root'],
27 minute => '*/5',
28 user => 'nginx',
29 require => Exec['fetch_notifications'],
30 }
31
24 include spawn-fcgi 32 include spawn-fcgi
25 package {'python-flup':} 33 package {'python-flup':}
26 34
27 spawn-fcgi::pool {'multiplexer': 35 spawn-fcgi::pool {'multiplexer':
28 ensure => present, 36 ensure => present,
29 fcgi_app => '/opt/sitescripts/multiplexer.fcgi', 37 fcgi_app => '/opt/sitescripts/multiplexer.fcgi',
30 socket => '/tmp/multiplexer-fastcgi.sock', 38 socket => '/tmp/multiplexer-fastcgi.sock',
31 mode => '0666', 39 mode => '0666',
32 user => 'nginx', 40 user => 'nginx',
33 children => 1, 41 children => 1,
(...skipping 13 matching lines...) Expand all
47 nginx::hostconfig{'notification.adblockplus.org': 55 nginx::hostconfig{'notification.adblockplus.org':
48 source => 'puppet:///modules/notificationserver/site.conf', 56 source => 'puppet:///modules/notificationserver/site.conf',
49 global_config => template('notificationserver/global.conf.erb'), 57 global_config => template('notificationserver/global.conf.erb'),
50 is_default => $is_default, 58 is_default => $is_default,
51 certificate => 'easylist-downloads.adblockplus.org_sslcert.pem', 59 certificate => 'easylist-downloads.adblockplus.org_sslcert.pem',
52 private_key => 'easylist-downloads.adblockplus.org_sslcert.key', 60 private_key => 'easylist-downloads.adblockplus.org_sslcert.key',
53 log => 'access_log_notification', 61 log => 'access_log_notification',
54 log_format => 'notification', 62 log_format => 'notification',
55 } 63 }
56 } 64 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld