]> git.openstreetmap.org Git - chef.git/blob - cookbooks/blog/recipes/default.rb
Merge remote-tracking branch 'github/pull/349' into master
[chef.git] / cookbooks / blog / recipes / default.rb
1 #
2 # Cookbook:: blog
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 #     https://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("blog", "passwords")
23
24 directory "/srv/blog.openstreetmap.org" do
25   owner "wordpress"
26   group "wordpress"
27   mode "755"
28 end
29
30 wordpress_site "blog.openstreetmap.org" do
31   aliases ["blog.osm.org", "blog.openstreetmap.com",
32            "blog.openstreetmap.net", "blog.openstreetmaps.org",
33            "blog.osmfoundation.org"]
34   directory "/srv/blog.openstreetmap.org/wp"
35   database_name "osm-blog"
36   database_user "osm-blog-user"
37   database_password passwords["osm-blog-user"]
38   urls "/casts" => "/srv/blog.openstreetmap.org/casts",
39        "/images" => "/srv/blog.openstreetmap.org/images",
40        "/static" => "/srv/blog.openstreetmap.org/static"
41   fpm_prometheus_port 11401
42 end
43
44 wordpress_theme "blog.openstreetmap.org-osmblog-wp-theme" do
45   theme "osmblog-wp-theme"
46   site "blog.openstreetmap.org"
47   repository "https://github.com/harry-wood/osmblog-wp-theme.git"
48 end
49
50 wordpress_plugin "blog.openstreetmap.org-google-analytics-for-wordpress" do
51   plugin "google-analytics-for-wordpress"
52   site "blog.openstreetmap.org"
53 end
54
55 wordpress_plugin "blog.openstreetmap.org-google-sitemap-generator" do
56   plugin "google-sitemap-generator"
57   site "blog.openstreetmap.org"
58 end
59
60 wordpress_plugin "blog.openstreetmap.org-shareadraft" do
61   plugin "shareadraft"
62   site "blog.openstreetmap.org"
63 end
64
65 wordpress_plugin "blog.openstreetmap.org-sitepress-multilingual-cms" do
66   plugin "sitepress-multilingual-cms"
67   site "blog.openstreetmap.org"
68   repository "https://git.openstreetmap.org/private/sitepress-multilingual-cms.git"
69   not_if { ENV["TEST_KITCHEN"] }
70 end
71
72 wordpress_plugin "blog.openstreetmap.org-wordpress-importer" do
73   plugin "wordpress-importer"
74   site "blog.openstreetmap.org"
75 end
76
77 git "/srv/blog.openstreetmap.org/casts" do
78   action :sync
79   repository "https://github.com/openstreetmap/opengeodata-podcasts.git"
80   depth 1
81   user "wordpress"
82   group "wordpress"
83 end
84
85 git "/srv/blog.openstreetmap.org/images" do
86   action :sync
87   repository "https://github.com/openstreetmap/opengeodata-images.git"
88   depth 1
89   user "wordpress"
90   group "wordpress"
91 end
92
93 git "/srv/blog.openstreetmap.org/static" do
94   action :sync
95   repository "https://github.com/openstreetmap/opengeodata-static.git"
96   depth 1
97   user "wordpress"
98   group "wordpress"
99 end
100
101 ssl_certificate "opengeodata.org" do
102   domains ["opengeodata.org", "www.opengeodata.org", "old.opengeodata.org"]
103   notifies :reload, "service[apache2]"
104 end
105
106 apache_site "opengeodata.org" do
107   template "opengeodata.erb"
108   directory "/srv/opengeodata.org"
109 end
110
111 template "/etc/cron.daily/blog-backup" do
112   source "backup.cron.erb"
113   owner "root"
114   group "root"
115   mode "750"
116   variables :passwords => passwords
117 end