]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/taginfo/recipes/default.rb
Update elasticsearch to 2.x on ridley
[chef.git] / cookbooks / taginfo / recipes / default.rb
index ec62ae45a776d49c14ff289491ca4ddc8cff451f..35166f1d02c89e2900a3d3b416da863605d1e9e5 100644 (file)
@@ -80,14 +80,14 @@ template "/etc/sudoers.d/taginfo" do
 end
 
 node[:taginfo][:sites].each do |site|
-  name = site[:name]
-  directory = site[:directory] || "/srv/#{name}"
+  site_name = site[:name]
+  directory = site[:directory] || "/srv/#{site_name}"
   description = site[:description]
   about = site[:about]
   icon = site[:icon]
   contact = site[:contact]
 
-  directory "/var/log/taginfo/#{name}" do
+  directory "/var/log/taginfo/#{site_name}" do
     owner "taginfo"
     group "taginfo"
     mode 0o755
@@ -102,7 +102,7 @@ node[:taginfo][:sites].each do |site|
   git "#{directory}/libosmium" do
     action :sync
     repository "git://github.com/osmcode/libosmium.git"
-    revision "v2.8.0"
+    revision "v2.10.3"
     user "taginfo"
     group "taginfo"
   end
@@ -110,14 +110,14 @@ node[:taginfo][:sites].each do |site|
   git "#{directory}/osmium-tool" do
     action :sync
     repository "git://github.com/osmcode/osmium-tool.git"
-    revision "v1.3.1"
+    revision "v1.4.1"
     user "taginfo"
     group "taginfo"
   end
 
   git "#{directory}/taginfo" do
     action :sync
-    repository "git://github.com/joto/taginfo.git"
+    repository "git://github.com/taginfo/taginfo.git"
     revision "osmorg-taginfo-live"
     user "taginfo"
     group "taginfo"
@@ -126,13 +126,13 @@ node[:taginfo][:sites].each do |site|
   settings = Chef::DelayedEvaluator.new do
     settings = JSON.parse(IO.read("#{directory}/taginfo/taginfo-config-example.json"))
 
-    settings["instance"]["url"] = "http://#{name}/"
+    settings["instance"]["url"] = "http://#{site_name}/"
     settings["instance"]["description"] = description
     settings["instance"]["about"] = about
     settings["instance"]["icon"] = "/img/logo/#{icon}.png"
     settings["instance"]["contact"] = contact
     settings["instance"]["access_control_allow_origin"] = ""
-    settings["logging"]["directory"] = "/var/log/taginfo/#{name}"
+    settings["logging"]["directory"] = "/var/log/taginfo/#{site_name}"
     settings["opensearch"]["shortname"] = "Taginfo"
     settings["opensearch"]["contact"] = "webmaster@openstreetmap.org"
     settings["sources"]["download"] = ""
@@ -231,10 +231,16 @@ node[:taginfo][:sites].each do |site|
     owner "taginfo"
     group "taginfo"
     mode 0o755
-    variables :name => name, :directory => directory
+    variables :name => site_name, :directory => directory
   end
 
-  apache_site name do
+  ssl_certificate site_name do
+    domains site_name
+    fallback_certificate "openstreetmap"
+    notifies :reload, "service[apache2]"
+  end
+
+  apache_site site_name do
     template "apache.erb"
     directory "#{directory}/taginfo/web/public"
   end