2 # Cookbook Name:: stats
5 # Copyright 2013, OpenStreetMap Foundation
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
11 # http://www.apache.org/licenses/LICENSE-2.0
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
20 include_recipe "apache"
24 node[:stats][:sites].each do |site|
25 template "/etc/awstats/awstats.#{site[:name]}.conf" do
26 source "awstats.conf.erb"
30 variables :site => site
34 template "/etc/cron.d/awstats" do
35 source "awstats.cron.erb"
39 variables :sites => node[:stats][:sites]
42 cookbook_file "/usr/local/bin/repack-archived-logs" do
48 template "/etc/cron.d/repack-archived-logs" do
49 source "repack.cron.erb"
55 directory "/srv/stats.openstreetmap.org" do
61 template "/srv/stats.openstreetmap.org/index.html" do
62 source "index.html.erb"
66 variables :sites => node[:stats][:sites]
69 apache_site "stats.openstreetmap.org" do
71 directory "/srv/stats.openstreetmap.org"