Install osmosis for taginfo
[chef.git] / cookbooks / taginfo / recipes / default.rb
index 227da7d7edc79ad2fdc88ed23ffc0e0685d75285..51ddbe96aa2de51b0d39502bb7e063e3ad0bcd64 100644 (file)
@@ -36,6 +36,8 @@ package "g++"
 
 package "sqlite3"
 
+package "osmosis"
+
 package "ruby"
 package "rubygems"
 gem_package "json"
@@ -101,6 +103,47 @@ node[:taginfo][:sites].each do |site|
     notifies :restart, "service[apache2]"
   end
 
+  directory "#{directory}/planet" do
+    owner "taginfo"
+    group "taginfo"
+    mode 0755
+  end
+
+  remote_file "#{directory}/planet/planet.pbf" do
+    action :create_if_missing
+    source "http://planet.openstreetmap.org/pbf/planet-latest.osm.pbf"
+    owner "taginfo"
+    group "taginfo"
+    mode 0644
+  end
+
+  template "#{directory}/planet/configuration.txt" do
+    source "configuration.txt.erb"
+    owner "taginfo"
+    group "taginfo"
+    mode 0644
+  end
+
+  file "#{directory}/planet/download.lock" do
+    owner "taginfo"
+    group "taginfo"
+    mode 0644
+  end
+
+  directory "#{directory}/bin" do
+    owner "taginfo"
+    group "taginfo"
+    mode 0755
+  end
+
+  template "#{directory}/bin/update-planet" do
+    source "update-planet.erb"
+    owner "taginfo"
+    group "taginfo"
+    mode 0755
+    variables :directory => directory
+  end
+
   directory "#{directory}/data" do
     owner "taginfo"
     group "taginfo"