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

Unified Diff: modules/statsclient/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/statsclient/manifests/init.pp
===================================================================
--- a/modules/statsclient/manifests/init.pp
+++ b/modules/statsclient/manifests/init.pp
@@ -1,15 +1,9 @@
-class statsclient (
- $log_path,
- $custom_sitescriptsini_source = [],
- ) {
-
- $sitescriptsini_source = flatten(['puppet:///modules/statsclient/sitescripts.ini', $custom_sitescriptsini_source])
-
+class statsclient {
user {'stats':
ensure => present,
home => '/home/stats',
managehome => true,
}
file {'/home/stats/.ssh':
ensure => directory,
@@ -26,55 +20,16 @@ class statsclient (
}
class {'ssh':
custom_configuration => 'Match User stats
AllowTcpForwarding no
X11Forwarding no
AllowAgentForwarding no
GatewayPorts no
- ForceCommand cat /var/www/stats.json',
- }
-
- class {'sitescripts':
- sitescriptsini_source => $sitescriptsini_source,
- }
-
- package {'pypy':}
-
- file {'/var/www/stats.json':
- ensure => present,
- owner => stats,
- mode => 644,
- }
-
- file {'/opt/cron_geoipdb_update.sh':
- ensure => file,
- owner => root,
- mode => 0750,
- source => 'puppet:///modules/statsclient/cron_geoipdb_update.sh',
+ ForceCommand (echo $SSH_ORIGINAL_COMMAND | grep -qv /) && cat "/var/log/nginx/$SSH_ORIGINAL_COMMAND"',
}
cron {'mirrorstats':
- ensure => present,
- require => [
- User['stats'],
- Package['pypy'],
- Exec["fetch_sitescripts"]
- ],
- command => "gzip -cd ${log_path} | pypy -m sitescripts.stats.bin.logprocessor",
- environment => ['MAILTO=admins@adblockplus.org,root', 'PYTHONPATH=/opt/sitescripts'],
+ ensure => absent,
user => stats,
- hour => 0,
- minute => 25,
- }
-
- 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