]> git.openstreetmap.org Git - chef.git/blob - cookbooks/stats/recipes/default.rb
Revert "Go readonly on smaug"
[chef.git] / cookbooks / stats / recipes / default.rb
1 #
2 # Cookbook Name:: stats
3 # Recipe:: default
4 #
5 # Copyright 2013, OpenStreetMap Foundation
6 #
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
10 #
11 #     http://www.apache.org/licenses/LICENSE-2.0
12 #
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.
18 #
19
20 include_recipe "apache"
21
22 package "awstats"
23 package "libgeo-ipfree-perl"
24
25 node[:stats][:sites].each do |site|
26   template "/etc/awstats/awstats.#{site[:name]}.conf" do
27     source "awstats.conf.erb"
28     owner "root"
29     group "root"
30     mode 0644
31     variables :site => site
32   end
33 end
34
35 template "/etc/cron.d/awstats" do
36   source "awstats.cron.erb"
37   owner "root"
38   group "root"
39   mode 0644
40   variables :sites => node[:stats][:sites]
41 end
42
43 cookbook_file "/usr/local/bin/repack-archived-logs" do
44   owner "root"
45   group "root"
46   mode 0755
47 end
48
49 template "/etc/cron.d/repack-archived-logs" do
50   source "repack.cron.erb"
51   owner "root"
52   group "root"
53   mode 0644
54 end
55
56 directory "/srv/stats.openstreetmap.org" do
57   owner "root"
58   group "root"
59   mode 0755
60 end
61
62 template "/srv/stats.openstreetmap.org/index.html" do
63   source "index.html.erb"
64   owner "root"
65   group "root"
66   mode 644
67   variables :sites => node[:stats][:sites]
68 end
69
70 cookbook_file "/srv/stats.openstreetmap.org/robots.txt" do
71   owner "root"
72   group "root"
73   mode 0644
74 end
75
76 apache_site "stats.openstreetmap.org" do
77   template "apache.erb"
78   directory "/srv/stats.openstreetmap.org"
79 end