SSL enable switch2osm and stateofthemap sites
[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 node.default[:ssl][:certificates] = node[:ssl][:certificates] | ["osmfoundation"]
21
22 include_recipe "wordpress"
23
24 passwords = data_bag_item("stateofthemap", "passwords")
25
26 directory "/srv/2007.stateofthemap.org" do
27   owner "wordpress"
28   group "wordpress"
29   mode 0755
30 end
31
32 wordpress_site "2007.stateofthemap.org" do
33   aliases "2007.stateofthemap.com"
34   directory "/srv/2007.stateofthemap.org/wp"
35   ssl_enabled true
36   ssl_certificate "osmfoundation"
37   ssl_certificate_chain "startcom"
38   database_name "sotm2007"
39   database_user "sotm2007"
40   database_password passwords["sotm2007"]
41   database_prefix "wp_sotm_"
42 end
43
44 wordpress_theme "refreshwp-11" do
45   site "2007.stateofthemap.org"
46   repository "git://git.openstreetmap.org/stateofthemap.git"
47   revision "theme-2007"
48 end
49
50 wordpress_plugin "geopress" do
51   site "2007.stateofthemap.org"
52 end
53
54 wordpress_plugin "sem-static-front" do
55   site "2007.stateofthemap.org"
56   repository "git://chef.openstreetmap.org/sem-static-front.git"
57 end
58
59 directory "/srv/2008.stateofthemap.org" do
60   owner "wordpress"
61   group "wordpress"
62   mode 0755
63 end
64
65 wordpress_site "2008.stateofthemap.org" do
66   aliases "2008.stateofthemap.com"
67   directory "/srv/2008.stateofthemap.org/wp"
68   ssl_enabled true
69   ssl_certificate "osmfoundation"
70   ssl_certificate_chain "startcom"
71   database_name "sotm2008"
72   database_user "sotm2008"
73   database_password passwords["sotm2008"]
74   database_prefix "wp_sotm08_"
75 end
76
77 wordpress_theme "refreshwp-11" do
78   site "2008.stateofthemap.org"
79   repository "git://git.openstreetmap.org/stateofthemap.git"
80   revision "theme-2008"
81 end
82
83 wordpress_plugin "geopress" do
84   site "2008.stateofthemap.org"
85 end
86
87 directory "/srv/2009.stateofthemap.org" do
88   owner "wordpress"
89   group "wordpress"
90   mode 0755
91 end
92
93 git "/srv/2009.stateofthemap.org" do
94   action :sync
95   repository "git://git.openstreetmap.org/stateofthemap.git"
96   revision "resources-2009"
97   user "wordpress"
98   group "wordpress"
99 end
100
101 wordpress_site "2009.stateofthemap.org" do
102   aliases "2009.stateofthemap.com"
103   directory "/srv/2009.stateofthemap.org/wp"
104   ssl_enabled true
105   ssl_certificate "osmfoundation"
106   ssl_certificate_chain "startcom"
107   database_name "sotm2009"
108   database_user "sotm2009"
109   database_password passwords["sotm2009"]
110   urls "/register" => "/srv/2009.stateofthemap.org/register",
111        "/register-pro-user" => "/srv/2009.stateofthemap.org/register-pro-user",
112        "/podcasts" => "/srv/2009.stateofthemap.org/podcasts"
113 end
114
115 wordpress_theme "aerodrome" do
116   site "2009.stateofthemap.org"
117   repository "git://git.openstreetmap.org/stateofthemap.git"
118   revision "theme-2009"
119 end
120
121 wordpress_plugin "wp-sticky" do
122   site "2009.stateofthemap.org"
123 end
124
125 directory "/srv/2010.stateofthemap.org" do
126   owner "wordpress"
127   group "wordpress"
128   mode 0755
129 end
130
131 git "/srv/2010.stateofthemap.org" do
132   action :sync
133   repository "git://git.openstreetmap.org/stateofthemap.git"
134   revision "resources-2010"
135   user "wordpress"
136   group "wordpress"
137 end
138
139 wordpress_site "2010.stateofthemap.org" do
140   aliases "2010.stateofthemap.com"
141   directory "/srv/2010.stateofthemap.org/wp"
142   ssl_enabled true
143   ssl_certificate "osmfoundation"
144   ssl_certificate_chain "startcom"
145   database_name "sotm2010"
146   database_user "sotm2010"
147   database_password passwords["sotm2010"]
148   urls "/register" => "/srv/2010.stateofthemap.org/register"
149 end
150
151 wordpress_theme "aerodrome" do
152   site "2010.stateofthemap.org"
153   repository "git://git.openstreetmap.org/stateofthemap.git"
154   revision "theme-2010"
155 end
156
157 wordpress_plugin "sitepress-multilingual-cms" do
158   site "2010.stateofthemap.org"
159   repository "git://chef.openstreetmap.org/sitepress-multilingual-cms.git"
160 end
161
162 wordpress_plugin "wp-sticky" do
163   site "2010.stateofthemap.org"
164 end
165
166 directory "/srv/2011.stateofthemap.org" do
167   owner "wordpress"
168   group "wordpress"
169   mode 0755
170 end
171
172 git "/srv/2011.stateofthemap.org" do
173   action :sync
174   repository "git://git.openstreetmap.org/stateofthemap.git"
175   revision "resources-2011"
176   user "wordpress"
177   group "wordpress"
178 end
179
180 wordpress_site "2011.stateofthemap.org" do
181   aliases "2011.stateofthemap.com"
182   directory "/srv/2011.stateofthemap.org/wp"
183   ssl_enabled true
184   ssl_certificate "osmfoundation"
185   ssl_certificate_chain "startcom"
186   database_name "sotm2011"
187   database_user "sotm2011"
188   database_password passwords["sotm2011"]
189   urls "/register" => "/srv/2011.stateofthemap.org/register"
190 end
191
192 wordpress_theme "aerodrome" do
193   site "2011.stateofthemap.org"
194   repository "git://git.openstreetmap.org/stateofthemap.git"
195   revision "theme-2011"
196 end
197
198 wordpress_plugin "sitepress-multilingual-cms" do
199   site "2011.stateofthemap.org"
200   repository "git://chef.openstreetmap.org/sitepress-multilingual-cms.git"
201 end
202
203 wordpress_plugin "wp-sticky" do
204   site "2011.stateofthemap.org"
205 end
206
207 directory "/srv/2012.stateofthemap.org" do
208   owner "wordpress"
209   group "wordpress"
210   mode 0755
211 end
212
213 git "/srv/2012.stateofthemap.org" do
214   action :sync
215   repository "git://git.openstreetmap.org/stateofthemap.git"
216   revision "resources-2012"
217   user "wordpress"
218   group "wordpress"
219 end
220
221 wordpress_site "2012.stateofthemap.org" do
222   aliases "2012.stateofthemap.com"
223   directory "/srv/2012.stateofthemap.org/wp"
224   ssl_enabled true
225   ssl_certificate "osmfoundation"
226   ssl_certificate_chain "startcom"
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 0750
257   variables :passwords => passwords
258 end