]> git.openstreetmap.org Git - chef.git/blob - cookbooks/stateofthemap/recipes/default.rb
Fix typo
[chef.git] / cookbooks / stateofthemap / recipes / default.rb
1 #
2 # Cookbook Name:: stateofthemap
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 "wordpress"
21
22 passwords = data_bag_item("stateofthemap", "passwords")
23
24 git "/srv/stateofthemap.org" do
25   action :sync
26   repository "git://git.openstreetmap.org/stateofthemap.git"
27   revision "chooser"
28   user "root"
29   group "root"
30 end
31
32 ssl_certificate "stateofthemap.org" do
33   domains ["stateofthemap.org", "www.stateofthemap.org",
34            "stateofthemap.com", "www.stateofthemap.com"]
35   notifies :reload, "service[apache2]"
36 end
37
38 apache_site "stateofthemap.org" do
39   template "apache.erb"
40   directory "/srv/stateofthemap.org"
41 end
42
43 directory "/srv/2007.stateofthemap.org" do
44   owner "wordpress"
45   group "wordpress"
46   mode 0o755
47 end
48
49 wordpress_site "2007.stateofthemap.org" do
50   aliases "2007.stateofthemap.com"
51   directory "/srv/2007.stateofthemap.org/wp"
52   ssl_enabled true
53   database_name "sotm2007"
54   database_user "sotm2007"
55   database_password passwords["sotm2007"]
56   database_prefix "wp_sotm_"
57 end
58
59 wordpress_theme "refreshwp-11" do
60   site "2007.stateofthemap.org"
61   repository "git://git.openstreetmap.org/stateofthemap.git"
62   revision "theme-2007"
63 end
64
65 wordpress_plugin "geopress" do
66   site "2007.stateofthemap.org"
67 end
68
69 directory "/srv/2008.stateofthemap.org" do
70   owner "wordpress"
71   group "wordpress"
72   mode 0o755
73 end
74
75 wordpress_site "2008.stateofthemap.org" do
76   aliases "2008.stateofthemap.com"
77   directory "/srv/2008.stateofthemap.org/wp"
78   ssl_enabled true
79   database_name "sotm2008"
80   database_user "sotm2008"
81   database_password passwords["sotm2008"]
82   database_prefix "wp_sotm08_"
83 end
84
85 wordpress_theme "refreshwp-11" do
86   site "2008.stateofthemap.org"
87   repository "git://git.openstreetmap.org/stateofthemap.git"
88   revision "theme-2008"
89 end
90
91 wordpress_plugin "geopress" do
92   site "2008.stateofthemap.org"
93 end
94
95 directory "/srv/2009.stateofthemap.org" do
96   owner "wordpress"
97   group "wordpress"
98   mode 0o755
99 end
100
101 git "/srv/2009.stateofthemap.org" do
102   action :sync
103   repository "git://git.openstreetmap.org/stateofthemap.git"
104   revision "resources-2009"
105   user "wordpress"
106   group "wordpress"
107 end
108
109 wordpress_site "2009.stateofthemap.org" do
110   aliases "2009.stateofthemap.com"
111   directory "/srv/2009.stateofthemap.org/wp"
112   ssl_enabled true
113   database_name "sotm2009"
114   database_user "sotm2009"
115   database_password passwords["sotm2009"]
116   urls "/register" => "/srv/2009.stateofthemap.org/register",
117        "/register-pro-user" => "/srv/2009.stateofthemap.org/register-pro-user",
118        "/podcasts" => "/srv/2009.stateofthemap.org/podcasts"
119 end
120
121 wordpress_theme "aerodrome" do
122   site "2009.stateofthemap.org"
123   repository "git://git.openstreetmap.org/stateofthemap.git"
124   revision "theme-2009"
125 end
126
127 wordpress_plugin "wp-sticky" do
128   site "2009.stateofthemap.org"
129 end
130
131 directory "/srv/2010.stateofthemap.org" do
132   owner "wordpress"
133   group "wordpress"
134   mode 0o755
135 end
136
137 git "/srv/2010.stateofthemap.org" do
138   action :sync
139   repository "git://git.openstreetmap.org/stateofthemap.git"
140   revision "resources-2010"
141   user "wordpress"
142   group "wordpress"
143 end
144
145 wordpress_site "2010.stateofthemap.org" do
146   aliases "2010.stateofthemap.com"
147   directory "/srv/2010.stateofthemap.org/wp"
148   ssl_enabled true
149   database_name "sotm2010"
150   database_user "sotm2010"
151   database_password passwords["sotm2010"]
152   urls "/register" => "/srv/2010.stateofthemap.org/register"
153 end
154
155 wordpress_theme "aerodrome" do
156   site "2010.stateofthemap.org"
157   repository "git://git.openstreetmap.org/stateofthemap.git"
158   revision "theme-2010"
159 end
160
161 wordpress_plugin "sitepress-multilingual-cms" do
162   site "2010.stateofthemap.org"
163   repository "git://chef.openstreetmap.org/sitepress-multilingual-cms.git"
164 end
165
166 wordpress_plugin "wp-sticky" do
167   site "2010.stateofthemap.org"
168 end
169
170 directory "/srv/2011.stateofthemap.org" do
171   owner "wordpress"
172   group "wordpress"
173   mode 0o755
174 end
175
176 git "/srv/2011.stateofthemap.org" do
177   action :sync
178   repository "git://git.openstreetmap.org/stateofthemap.git"
179   revision "resources-2011"
180   user "wordpress"
181   group "wordpress"
182 end
183
184 wordpress_site "2011.stateofthemap.org" do
185   aliases "2011.stateofthemap.com"
186   directory "/srv/2011.stateofthemap.org/wp"
187   ssl_enabled true
188   database_name "sotm2011"
189   database_user "sotm2011"
190   database_password passwords["sotm2011"]
191   urls "/register" => "/srv/2011.stateofthemap.org/register"
192 end
193
194 wordpress_theme "aerodrome" do
195   site "2011.stateofthemap.org"
196   repository "git://git.openstreetmap.org/stateofthemap.git"
197   revision "theme-2011"
198 end
199
200 wordpress_plugin "sitepress-multilingual-cms" do
201   site "2011.stateofthemap.org"
202   repository "git://chef.openstreetmap.org/sitepress-multilingual-cms.git"
203 end
204
205 wordpress_plugin "wp-sticky" do
206   site "2011.stateofthemap.org"
207 end
208
209 directory "/srv/2012.stateofthemap.org" do
210   owner "wordpress"
211   group "wordpress"
212   mode 0o755
213 end
214
215 git "/srv/2012.stateofthemap.org" do
216   action :sync
217   repository "git://git.openstreetmap.org/stateofthemap.git"
218   revision "resources-2012"
219   user "wordpress"
220   group "wordpress"
221 end
222
223 wordpress_site "2012.stateofthemap.org" do
224   aliases "2012.stateofthemap.com"
225   directory "/srv/2012.stateofthemap.org/wp"
226   ssl_enabled true
227   database_name "sotm2012"
228   database_user "sotm2012"
229   database_password passwords["sotm2012"]
230   urls "/register" => "/srv/2012.stateofthemap.org/register"
231 end
232
233 wordpress_theme "aerodrome" do
234   site "2012.stateofthemap.org"
235   repository "git://git.openstreetmap.org/stateofthemap.git"
236   revision "theme-2012"
237 end
238
239 wordpress_plugin "leaflet-maps-marker" do
240   site "2012.stateofthemap.org"
241 end
242
243 wordpress_plugin "sitepress-multilingual-cms" do
244   site "2012.stateofthemap.org"
245   repository "git://chef.openstreetmap.org/sitepress-multilingual-cms.git"
246 end
247
248 wordpress_plugin "wp-sticky" do
249   site "2012.stateofthemap.org"
250 end
251
252 template "/etc/cron.daily/sotm-backup" do
253   source "backup.cron.erb"
254   owner "root"
255   group "root"
256   mode 0o750
257   variables :passwords => passwords
258 end