OLD | NEW |
1 class statsclient ( | 1 class statsclient ( |
2 $log_path, | 2 $log_path, |
3 $custom_sitescriptsini_source = [], | 3 $custom_sitescriptsini_source = [], |
4 ) { | 4 ) { |
5 | 5 |
6 $sitescriptsini_source = flatten(['puppet:///modules/statsclient/sitescripts.i
ni', $custom_sitescriptsini_source]) | 6 $sitescriptsini_source = flatten(['puppet:///modules/statsclient/sitescripts.i
ni', $custom_sitescriptsini_source]) |
7 | 7 |
8 user {'stats': | 8 user {'stats': |
9 ensure => present, | 9 ensure => present, |
10 home => '/home/stats', | 10 home => '/home/stats', |
(...skipping 20 matching lines...) Expand all Loading... |
31 X11Forwarding no | 31 X11Forwarding no |
32 AllowAgentForwarding no | 32 AllowAgentForwarding no |
33 GatewayPorts no | 33 GatewayPorts no |
34 ForceCommand cat /var/www/stats.json', | 34 ForceCommand cat /var/www/stats.json', |
35 } | 35 } |
36 | 36 |
37 class {'sitescripts': | 37 class {'sitescripts': |
38 sitescriptsini_source => $sitescriptsini_source, | 38 sitescriptsini_source => $sitescriptsini_source, |
39 } | 39 } |
40 | 40 |
41 package {'python-geoip':} | 41 package {'pypy':} |
42 | |
43 package {'python-simplejson':} | |
44 | |
45 package {'python-jinja2':} | |
46 | 42 |
47 file {'/var/www/stats.json': | 43 file {'/var/www/stats.json': |
48 ensure => present, | 44 ensure => present, |
49 owner => stats, | 45 owner => stats, |
50 mode => 644, | 46 mode => 644, |
51 } | 47 } |
52 | 48 |
53 file {'/opt/cron_geoipdb_update.sh': | 49 file {'/opt/cron_geoipdb_update.sh': |
54 ensure => file, | 50 ensure => file, |
55 owner => root, | 51 owner => root, |
56 mode => 0750, | 52 mode => 0750, |
57 source => 'puppet:///modules/statsclient/cron_geoipdb_update.sh', | 53 source => 'puppet:///modules/statsclient/cron_geoipdb_update.sh', |
58 } | 54 } |
59 | 55 |
60 cron {'mirrorstats': | 56 cron {'mirrorstats': |
61 ensure => present, | 57 ensure => present, |
62 require => [ | 58 require => [ |
63 User['stats'], | 59 User['stats'], |
64 Package['python-geoip'], | 60 Package['pypy'], |
65 Exec["fetch_sitescripts"] | 61 Exec["fetch_sitescripts"] |
66 ], | 62 ], |
67 command => "gzip -cd ${log_path} | python -m sitescripts.stats.bin.logproces
sor", | 63 command => "gzip -cd ${log_path} | pypy -m sitescripts.stats.bin.logprocesso
r", |
68 environment => ['MAILTO=admins@adblockplus.org', 'PYTHONPATH=/opt/sitescript
s'], | 64 environment => ['MAILTO=admins@adblockplus.org', 'PYTHONPATH=/opt/sitescript
s'], |
69 user => stats, | 65 user => stats, |
70 hour => 0, | 66 hour => 0, |
71 minute => 25, | 67 minute => 25, |
72 } | 68 } |
73 | 69 |
74 cron {'geoipdb_update': | 70 cron {'geoipdb_update': |
75 ensure => present, | 71 ensure => present, |
76 require => File['/opt/cron_geoipdb_update.sh'], | 72 require => File['/opt/cron_geoipdb_update.sh'], |
77 command => '/opt/cron_geoipdb_update.sh', | 73 command => '/opt/cron_geoipdb_update.sh', |
78 user => root, | 74 user => root, |
79 hour => 3, | 75 hour => 3, |
80 minute => 15, | 76 minute => 15, |
81 monthday => 3, | 77 monthday => 3, |
82 } | 78 } |
83 } | 79 } |
OLD | NEW |