]> git.openstreetmap.org Git - chef.git/blob - cookbooks/forum/recipes/default.rb
355f1379f77000bd101aa3c2b2046dd2166b0e35
[chef.git] / cookbooks / forum / recipes / default.rb
1 #
2 # Cookbook Name:: forum
3 # Recipe:: default
4 #
5 # Copyright 2014, 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 include_recipe "apache::ssl"
20 include_recipe "git"
21 include_recipe "mysql"
22
23 passwords = data_bag_item("forum", "passwords")
24
25 package "php5"
26 package "php5-cli"
27 package "php-apc"
28
29 apache_module "php5"
30
31 apache_site "default" do
32   action [ :disable ]
33 end
34
35 apache_site "forum.openstreetmap.org" do
36   template "apache.erb"
37 end
38
39 directory "/srv/forum.openstreetmap.org" do
40   owner "forum"
41   group "forum"
42   mode 0755
43 end
44
45 git "/srv/forum.openstreetmap.org/html/" do
46   action :sync
47   repository "http://github.com/fluxbb/fluxbb.git"
48   revision "refs/tags/fluxbb-1.5.6"
49   depth 1
50   user "forum"
51   group "forum"
52 end
53
54 directory "/srv/forum.openstreetmap.org/html/cache/" do
55   owner "www-data"
56   group "www-data"
57   mode 0755
58 end
59
60 directory "/srv/forum.openstreetmap.org/html/img/avatars/" do
61   owner "www-data"
62   group "www-data"
63   mode 0755
64 end
65
66 mysql_user "forum@localhost" do
67   password passwords["database"]
68 end
69
70 mysql_database "forum" do
71   permissions "forum@localhost" => :all
72 end
73
74 template "/etc/cron.daily/forum-backup" do
75   source "backup.cron.erb"
76   owner "root"
77   group "root"
78   mode 0750
79   variables :passwords => passwords
80 end