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

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

Issue 11468051: Update stats processing (Closed)
Patch Set: Created Aug. 23, 2013, 1:58 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 class statsclient (
2 $log_path,
3 $custom_sitescriptsini_source = [],
4 ) {
5
6 $sitescriptsini_source = flatten(['puppet:///modules/statsclient/sitescripts.i ni', $custom_sitescriptsini_source])
7
8 user {'stats':
9 ensure => present,
10 home => '/home/stats',
11 managehome => true,
12 }
13
14 file {'/home/stats/.ssh':
15 ensure => directory,
16 owner => stats,
17 mode => 0600,
18 require => User['stats'],
19 }
20
21 file {'/home/stats/.ssh/authorized_keys':
22 ensure => present,
23 owner => stats,
24 mode => 0400,
25 source => 'puppet:///modules/private/stats-authorized_keys',
26 }
27
28 class {'ssh':
29 custom_configuration => 'Match User stats
30 AllowTcpForwarding no
31 X11Forwarding no
32 AllowAgentForwarding no
33 GatewayPorts no
34 ForceCommand cat /var/www/stats.json',
35 }
36
37 class {'sitescripts':
38 sitescriptsini_source => $sitescriptsini_source,
39 }
40
41 package {'python-geoip':}
42
43 package {'python-simplejson':}
44
45 package {'python-jinja2':}
Wladimir Palant 2013/08/23 14:01:38 The log processor doesn't really need Jinja2. Howe
Felix Dahlke 2013/08/28 14:43:32 Did you know that you can require multiple package
46
47 file {'/var/www/stats.json':
48 ensure => present,
49 owner => stats,
50 mode => 644,
51 }
52
53 file {'/opt/cron_geoipdb_update.sh':
54 ensure => file,
55 owner => root,
56 mode => 0750,
57 source => 'puppet:///modules/statsclient/cron_geoipdb_update.sh',
58 }
59
60 cron {'mirrorstats':
61 ensure => present,
62 require => [
63 User['stats'],
64 Package['python-geoip'],
65 Exec["fetch_sitescripts"]
66 ],
67 command => "gzip -cd ${log_path} | python -m sitescripts.stats.bin.logproces sor",
68 environment => ['MAILTO=admins@adblockplus.org', 'PYTHONPATH=/opt/sitescript s'],
69 user => stats,
70 hour => 0,
71 minute => 25,
72 }
73
74 cron {'geoipdb_update':
75 ensure => present,
76 require => File['/opt/cron_geoipdb_update.sh'],
77 command => '/opt/cron_geoipdb_update.sh',
78 user => root,
79 hour => 3,
80 minute => 15,
81 monthday => 3,
82 }
83 }
OLDNEW

Powered by Google App Engine
This is Rietveld