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

Side by Side Diff: modules/statsmaster/manifests/awstats.pp

Issue 5667089633247232: Issue 479 - Make AWStats produce daily reports as well (Closed)
Patch Set: Created June 24, 2014, 6:08 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | modules/statsmaster/templates/awstats.conf » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 class statsmaster::awstats { 1 class statsmaster::awstats {
2 package {['awstats', 'libgeo-ip-perl']:} 2 package {['awstats', 'libgeo-ip-perl']:}
3 3
4 file {['/var/www/awstatsdata', '/var/www/awstatsconf', '/var/www/awstats']: 4 file {['/var/www/awstatsdata', '/var/www/awstatsdatadaily',
5 '/var/www/awstatsconf', '/var/www/awstats',
6 '/var/www/awstats/archive', '/var/www/awstats/daily']:
5 ensure => directory, 7 ensure => directory,
6 owner => root, 8 owner => root,
7 mode => 0755, 9 mode => 0755,
8 } 10 }
9 11
10 file {'/etc/cron.d/awstats': 12 file {'/etc/cron.d/awstats':
11 # AWStats package thinks that running AWStats without proper configuration 13 # AWStats package thinks that running AWStats without proper configuration
12 # every 10 minutes is a good idea. 14 # every 10 minutes is a good idea.
13 ensure => absent, 15 ensure => absent,
14 } 16 }
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 } 57 }
56 58
57 define siteconfig($host, $log) { 59 define siteconfig($host, $log) {
58 file {"/var/www/awstatsconf/awstats.$title.conf": 60 file {"/var/www/awstatsconf/awstats.$title.conf":
59 ensure => present, 61 ensure => present,
60 mode => 0444, 62 mode => 0444,
61 owner => root, 63 owner => root,
62 content => template('statsmaster/awstats.conf'), 64 content => template('statsmaster/awstats.conf'),
63 } 65 }
64 66
65 file {["/var/www/awstatsdata/$title", "/var/www/awstats/$title", 67 file {["/var/www/awstatsdata/$title", "/var/www/awstatsdatadaily/$title",
66 "/var/www/awstats/archive/$title"]: 68 "/var/www/awstats/$title", "/var/www/awstats/archive/$title",
69 "/var/www/awstats/daily/$title"]:
67 ensure => directory, 70 ensure => directory,
68 mode => 0755, 71 mode => 0755,
69 owner => stats, 72 owner => stats,
70 } 73 }
71 74
72 concat::fragment {"index_$title": 75 concat::fragment {"index_$title":
73 target => '/var/www/awstats/index.html', 76 target => '/var/www/awstats/index.html',
74 content => template('statsmaster/index_item.html.erb'), 77 content => template('statsmaster/index_item.html.erb'),
75 order => $title, 78 order => $title,
76 } 79 }
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 log => 'access_log_eyeo.com', 127 log => 'access_log_eyeo.com',
125 }, 128 },
126 'intraforum.adblockplus.org' => { 129 'intraforum.adblockplus.org' => {
127 host => 'server_10.adblockplus.org', 130 host => 'server_10.adblockplus.org',
128 log => 'access_log_intraforum', 131 log => 'access_log_intraforum',
129 }, 132 },
130 } 133 }
131 134
132 create_resources(statsmaster::awstats::siteconfig, $sites) 135 create_resources(statsmaster::awstats::siteconfig, $sites)
133 136
137 #
138 # IMPORTANT: This will only work correctly if the following bugs are fixed
139 # in your AWStats instance (might require manual patching):
140 #
141 # * https://sourceforge.net/p/awstats/bugs/873/
142 # * https://sourceforge.net/p/awstats/bugs/929/
143 #
144
134 cron {'awstats_update': 145 cron {'awstats_update':
135 ensure => present, 146 ensure => present,
136 require => [ 147 require => [
137 Package['awstats', 'libgeo-ip-perl'], 148 Package['awstats', 'libgeo-ip-perl'],
138 File['/home/stats/process_logs', '/home/stats/build_static', 149 File['/home/stats/process_logs', '/home/stats/build_static',
139 '/var/www/awstatsconf', '/var/www/awstatsdata', '/var/www/awstats'], 150 '/var/www/awstatsdata', '/var/www/awstatsdatadaily',
151 '/var/www/awstats', '/var/www/awstatsconf'],
140 ], 152 ],
141 command => '/home/stats/process_logs && /home/stats/build_static', 153 command => '/home/stats/process_logs && /home/stats/build_static',
142 environment => ['MAILTO=admins@adblockplus.org,root'], 154 environment => ['MAILTO=admins@adblockplus.org,root'],
143 user => stats, 155 user => stats,
144 hour => 4, 156 hour => 4,
145 minute => 0, 157 minute => 0,
146 } 158 }
147 159
148 cron {'awstats_prevmonth': 160 cron {'awstats_prevmonth':
149 ensure => present, 161 ensure => present,
150 require => [ 162 require => [
151 Package['awstats'], 163 Package['awstats'],
152 File['/home/stats/build_static', '/home/stats/anonymize_ips', 164 File['/home/stats/build_static', '/home/stats/anonymize_ips',
153 '/var/www/awstatsconf', '/var/www/awstatsdata', '/var/www/awstats'], 165 '/var/www/awstatsdata', '/var/www/awstatsdatadaily',
166 '/var/www/awstatsconf', '/var/www/awstats'],
154 ], 167 ],
155 command => '/home/stats/anonymize_ips prevmonth && /home/stats/build_static prevmonth', 168 command => '/home/stats/anonymize_ips prevmonth && /home/stats/build_static prevmonth',
156 environment => ['MAILTO=admins@adblockplus.org,root'], 169 environment => ['MAILTO=admins@adblockplus.org,root'],
157 user => stats, 170 user => stats,
158 monthday => 1, 171 monthday => 1,
159 hour => 6, 172 hour => 6,
160 minute => 0, 173 minute => 0,
161 } 174 }
162 } 175 }
OLDNEW
« no previous file with comments | « no previous file | modules/statsmaster/templates/awstats.conf » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld