]> git.openstreetmap.org Git - chef.git/commitdiff
More work on taginfo
authorTom Hughes <tom@compton.nu>
Sun, 9 Feb 2014 21:53:39 +0000 (21:53 +0000)
committerTom Hughes <tom@compton.nu>
Sun, 9 Feb 2014 21:53:39 +0000 (21:53 +0000)
cookbooks/taginfo/recipes/default.rb
roles/taginfo.rb

index ea329a57b310d8f014cd1dae1f21f18e47bc8c0e..bdac494557738d6431cdb019be458f53ce788cb0 100644 (file)
@@ -51,6 +51,9 @@ munin_plugin "passenger_requests"
 node[:taginfo][:sites].each do |site|
   name = site[:name]
   directory = site[:directory] || "/srv/#{name}"
+  description = site[:description]
+  icon = site[:icon]
+  contact = site[:contact]
 
   directory directory do
     owner "taginfo"
@@ -75,6 +78,12 @@ node[:taginfo][:sites].each do |site|
   end
 
   settings = edit_file "#{directory}/taginfo/taginfo-config-example.json" do |line|
+    line.gsub!(/^( *)"url": ".*",/, "\\1\"url\": \"http://#{name}/\",")
+    line.gsub!(/^( *)"description": ".*Change this text.*,/, "\\1\"description\": \"#{description}\",")
+    line.gsub!(/^( *)"icon": ".*",/, "\\1\"icon\": \"/img/logo/#{icon}.png\",")
+    line.gsub!(/^( *)"contact": "Anonymous",/, "\\1\"contact\": \"#{contact}\",")
+    line.gsub!(/^( *)"shortname": ".*",/, "\\1\"shortname\": \"Taginfo\",")
+    line.gsub!(/^( *)"contact": "somebody@example.com",/, "\\1\"contact\": \"webmaster@openstreetmap.org\",")
     line.gsub!(/^( *)"cxxflags": ".*",/, "\\1\"cxxflags\": \"-I../../osmium/include\",")
 
     line
index 2a273725f76b095b03edbce6db3a1538deee52aa..026d38656f4b0272e54fc11d53d274fd11684719 100644 (file)
@@ -18,7 +18,12 @@ default_attributes(
   },
   :taginfo => {
     :sites => [
-      { :name => "taginfo.openstreetmap.org" }
+      {
+        :name => "taginfo.openstreetmap.org",
+        :description => "This is the main taginfo site. It contains OSM data for the whole planet and is updated daily.",
+        :icon => "world",
+        :contact => "Jochen Topf <jochen@remote.org>"
+      }
     ]
   }
 )