From 601184bb64fce3feb74b9f4fd933649d05b92a22 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Sun, 9 Feb 2014 21:53:39 +0000 Subject: [PATCH 1/1] More work on taginfo --- cookbooks/taginfo/recipes/default.rb | 9 +++++++++ roles/taginfo.rb | 7 ++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/cookbooks/taginfo/recipes/default.rb b/cookbooks/taginfo/recipes/default.rb index ea329a57b..bdac49455 100644 --- a/cookbooks/taginfo/recipes/default.rb +++ b/cookbooks/taginfo/recipes/default.rb @@ -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 diff --git a/roles/taginfo.rb b/roles/taginfo.rb index 2a273725f..026d38656 100644 --- a/roles/taginfo.rb +++ b/roles/taginfo.rb @@ -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 " + } ] } ) -- 2.43.2