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

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

Issue 5143068516810752: Added new stats server and user counter page (Closed)
Patch Set: Centralized stats processing Created Dec. 20, 2013, 3:47 p.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
Index: modules/statsmaster/manifests/init.pp
===================================================================
--- a/modules/statsmaster/manifests/init.pp
+++ b/modules/statsmaster/manifests/init.pp
@@ -21,17 +21,17 @@ class statsmaster {
file {'/home/stats/.ssh/known_hosts':
ensure => present,
owner => stats,
mode => 0400,
source => 'puppet:///modules/statsmaster/known_hosts',
}
- package {['python-simplejson', 'python-jinja2']:}
+ package {['pypy', 'python-jinja2']:}
class {'sitescripts':
sitescriptsini_source => 'puppet:///modules/statsmaster/sitescripts.ini',
}
class {'nginx':
worker_processes => 2,
worker_connections => 4000,
@@ -56,16 +56,23 @@ class statsmaster {
}
file {'/var/www/statsdata':
ensure => directory,
mode => 0755,
owner => stats,
}
+ file {'/var/www/statsdata/usercounts.html':
+ ensure => file,
+ mode => 0444,
+ source => 'puppet:///modules/statsmaster/usercounts.html',
+ owner => stats,
+ }
+
file {'/var/www/htpasswd':
ensure => file,
mode => 0444,
source => 'puppet:///modules/private/stats-htpasswd',
}
file {'/etc/nginx/sites-available/adblockplus.org_sslcert.key':
ensure => file,
@@ -93,20 +100,37 @@ class statsmaster {
mode => 0444,
require => Nginx::Hostconfig['stats.adblockplus.org'],
source => 'puppet:///modules/statsmaster/logrotate'
}
cron {'updatestats':
ensure => present,
require => [
- User['stats'],
- Package['python-simplejson'],
+ Package['pypy'],
Package['python-jinja2'],
Exec["fetch_sitescripts"]
],
- command => "python -m sitescripts.stats.bin.datamerger && python -m sitescripts.stats.bin.pagegenerator",
+ command => "pypy -m sitescripts.stats.bin.logprocessor && python -m sitescripts.stats.bin.pagegenerator",
environment => ['MAILTO=admins@adblockplus.org,root', 'PYTHONPATH=/opt/sitescripts'],
user => stats,
- hour => 4,
+ hour => 1,
minute => 30,
}
+
+ file {'/opt/cron_geoipdb_update.sh':
+ ensure => file,
+ owner => root,
+ mode => 0750,
+ source => 'puppet:///modules/statsmaster/cron_geoipdb_update.sh',
+ }
+
+ cron {'geoipdb_update':
+ ensure => present,
+ require => File['/opt/cron_geoipdb_update.sh'],
+ command => '/opt/cron_geoipdb_update.sh',
+ environment => ['MAILTO=admins@adblockplus.org,root'],
+ user => root,
+ hour => 3,
+ minute => 15,
+ monthday => 3,
+ }
}

Powered by Google App Engine
This is Rietveld