OLD | NEW |
1 class statsmaster( | 1 class statsmaster( |
2 $domain, | 2 $domain, |
3 $certificate, | 3 $certificate, |
4 $private_key, | 4 $private_key, |
5 $is_default=false | 5 $is_default=false |
6 ) { | 6 ) { |
| 7 |
| 8 include statsmaster::downloads, statsmaster::awstats |
| 9 |
7 user {'stats': | 10 user {'stats': |
8 ensure => present, | 11 ensure => present, |
9 home => '/home/stats', | 12 home => '/home/stats', |
10 managehome => true, | 13 managehome => true, |
11 } | 14 } |
12 | 15 |
| 16 File { |
| 17 group => root, |
| 18 } |
| 19 |
13 file {'/home/stats/.ssh': | 20 file {'/home/stats/.ssh': |
14 ensure => directory, | 21 ensure => directory, |
15 owner => stats, | 22 owner => stats, |
16 mode => 0600, | 23 mode => 0600, |
17 require => User['stats'], | 24 require => User['stats'], |
18 } | 25 } |
19 | 26 |
20 file {'/home/stats/.ssh/id_rsa': | 27 file {'/home/stats/.ssh/id_rsa': |
21 ensure => present, | 28 ensure => present, |
22 owner => stats, | 29 owner => stats, |
23 mode => 0400, | 30 mode => 0400, |
24 source => 'puppet:///modules/private/stats@stats.adblockplus.org', | 31 source => 'puppet:///modules/private/stats@stats.adblockplus.org', |
25 } | 32 } |
26 | 33 |
27 file {'/home/stats/.ssh/known_hosts': | 34 file {'/home/stats/.ssh/known_hosts': |
28 ensure => present, | 35 ensure => present, |
29 owner => stats, | 36 owner => stats, |
30 mode => 0400, | 37 mode => 0400, |
31 source => 'puppet:///modules/statsmaster/known_hosts', | 38 source => 'puppet:///modules/statsmaster/known_hosts', |
32 } | 39 } |
33 | 40 |
34 package {['pypy', 'python-jinja2']:} | |
35 | |
36 class {'sitescripts': | |
37 sitescriptsini_source => 'puppet:///modules/statsmaster/sitescripts.ini', | |
38 } | |
39 | |
40 class {'nginx': | 41 class {'nginx': |
41 worker_processes => 2, | 42 worker_processes => 2, |
42 worker_connections => 4000, | 43 worker_connections => 4000, |
43 ssl_session_cache => off, | 44 ssl_session_cache => off, |
44 } | 45 } |
45 | 46 |
46 File { | |
47 owner => root, | |
48 group => root, | |
49 } | |
50 | |
51 file {'/var/www': | 47 file {'/var/www': |
52 ensure => directory, | 48 ensure => directory, |
53 mode => 0755, | 49 mode => 0755, |
54 require => Package['nginx'], | 50 owner => root |
55 } | |
56 | |
57 file {'/var/www/stats': | |
58 ensure => directory, | |
59 mode => 0755, | |
60 owner => stats, | |
61 } | |
62 | |
63 file {'/var/www/statsdata': | |
64 ensure => directory, | |
65 mode => 0755, | |
66 owner => stats, | |
67 } | |
68 | |
69 file {'/var/www/statsdata/usercounts.html': | |
70 ensure => file, | |
71 mode => 0444, | |
72 source => 'puppet:///modules/statsmaster/usercounts.html', | |
73 owner => stats, | |
74 } | 51 } |
75 | 52 |
76 file {'/var/www/htpasswd': | 53 file {'/var/www/htpasswd': |
77 ensure => file, | 54 ensure => file, |
78 mode => 0444, | 55 mode => 0444, |
79 source => 'puppet:///modules/private/stats-htpasswd', | 56 source => 'puppet:///modules/private/stats-htpasswd', |
| 57 owner => root, |
80 } | 58 } |
81 | 59 |
82 nginx::hostconfig{$domain: | 60 nginx::hostconfig{$domain: |
83 source => 'puppet:///modules/statsmaster/site.conf', | 61 source => 'puppet:///modules/statsmaster/site.conf', |
84 is_default => $is_default, | 62 is_default => $is_default, |
85 certificate => $certificate, | 63 certificate => $certificate, |
86 private_key => $private_key, | 64 private_key => $private_key, |
87 log => 'access_log_stats' | 65 log => 'access_log_stats' |
88 } | 66 } |
89 | 67 |
90 cron {'updatestats': | |
91 ensure => present, | |
92 require => [ | |
93 Package['pypy'], | |
94 Package['python-jinja2'], | |
95 Exec["fetch_sitescripts"] | |
96 ], | |
97 command => "pypy -m sitescripts.stats.bin.logprocessor && python -m sitescri
pts.stats.bin.pagegenerator", | |
98 environment => ['MAILTO=admins@adblockplus.org,root', 'PYTHONPATH=/opt/sites
cripts'], | |
99 user => stats, | |
100 hour => 1, | |
101 minute => 30, | |
102 } | |
103 | |
104 file {'/opt/cron_geoipdb_update.sh': | 68 file {'/opt/cron_geoipdb_update.sh': |
105 ensure => file, | 69 ensure => file, |
106 owner => root, | 70 owner => root, |
107 mode => 0750, | 71 mode => 0750, |
108 source => 'puppet:///modules/statsmaster/cron_geoipdb_update.sh', | 72 source => 'puppet:///modules/statsmaster/cron_geoipdb_update.sh', |
109 } | 73 } |
110 | 74 |
111 cron {'geoipdb_update': | 75 cron {'geoipdb_update': |
112 ensure => present, | 76 ensure => present, |
113 require => File['/opt/cron_geoipdb_update.sh'], | 77 require => File['/opt/cron_geoipdb_update.sh'], |
114 command => '/opt/cron_geoipdb_update.sh', | 78 command => '/opt/cron_geoipdb_update.sh', |
115 environment => ['MAILTO=admins@adblockplus.org,root'], | 79 environment => ['MAILTO=admins@adblockplus.org,root'], |
116 user => root, | 80 user => root, |
117 hour => 3, | 81 hour => 3, |
118 minute => 15, | 82 minute => 15, |
119 monthday => 3, | 83 monthday => 3, |
120 } | 84 } |
121 } | 85 } |
OLD | NEW |