]> git.openstreetmap.org Git - chef.git/blob - cookbooks/piwik/recipes/default.rb
Allow % in local parts for locally submitted mail
[chef.git] / cookbooks / piwik / recipes / default.rb
1 #
2 # Cookbook Name:: piwik
3 # Recipe:: default
4 #
5 # Copyright 2011, 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::ssl"
21 include_recipe "mysql"
22
23 passwords = data_bag_item("piwik", "passwords")
24
25 package "php5"
26 package "php5-cli"
27 package "php5-curl"
28 package "php5-mysql"
29 package "php5-gd"
30
31 package "php-apc"
32
33 package "geoip-database-contrib"
34
35 apache_module "php5"
36 apache_module "geoip"
37
38 apache_site "piwik.openstreetmap.org" do
39   template "apache.erb"
40 end
41
42 directory "/srv/piwik.openstreetmap.org" do
43   owner "root"
44   group "root"
45   mode "0755"
46 end
47
48 directory "/srv/piwik.openstreetmap.org/config" do
49   owner "www-data"
50   group "www-data"
51   mode "0755"
52 end
53
54 directory "/srv/piwik.openstreetmap.org/tmp" do
55   owner "www-data"
56   group "www-data"
57   mode "0755"
58 end
59
60 template "/etc/cron.d/piwiki" do
61   source "cron.erb"
62   owner "root"
63   group "root"
64   mode "0644"
65 end
66
67 mysql_user "piwik@localhost" do
68   password passwords["database"]
69 end
70
71 mysql_database "piwik" do
72   permissions "piwik@localhost" => :all
73 end