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

Unified Diff: modules/notificationserver/manifests/init.pp

Issue 11296008: Notification server: Generate notification.json from notifications repository (Closed)
Patch Set: Created July 26, 2013, 11:52 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « modules/notificationserver/files/sitescripts.ini ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: modules/notificationserver/manifests/init.pp
===================================================================
--- a/modules/notificationserver/manifests/init.pp
+++ b/modules/notificationserver/manifests/init.pp
@@ -1,35 +1,50 @@
class notificationserver {
class {'nginx':
worker_processes => 2,
worker_connections => 4000,
ssl_session_cache => off,
}
+ class {'sitescripts':
+ sitescriptsini_source => 'puppet:///modules/notificationserver/sitescripts.ini'
+ }
+
file {'/var/www':
ensure => directory,
owner => nginx,
mode => 0755,
require => Package['nginx']
}
file {'/var/www/notification':
ensure => directory,
owner => nginx,
mode => 0755,
require => Package['nginx']
}
- file {'/var/www/notification/notification.json':
- ensure => file,
- owner => nginx,
- mode => 644,
- require => Package['nginx'],
- source => 'puppet:///modules/notificationserver/notification.json'
+ 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'],
+ onlyif => "test ! -d /opt/notifications"
+ }
+
+ cron {"update_notifications":
+ ensure => present,
+ command => "python -m sitescripts.management.bin.generateNotifications",
+ environment => ['MAILTO=admins@adblockplus.org', 'PYTHONPATH=/opt/sitescripts'],
+ user => nginx,
+ minute => '*/10',
+ require => [
+ Exec["fetch_notifications"],
+ Exec["fetch_sitescripts"]
+ ],
}
File {
owner => root,
group => root,
mode => 0644,
}
« no previous file with comments | « modules/notificationserver/files/sitescripts.ini ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld