]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/tile/recipes/default.rb
Avoid cloning directory resources in the tile recipe
[chef.git] / cookbooks / tile / recipes / default.rb
index c9f4d137153f272c148483111304cd831c97a3cc..0a703017cc8452fbe28c2d46260385227e6a7e71 100644 (file)
@@ -158,12 +158,17 @@ package "mapnik-utils"
 node[:tile][:data].each_value do |data|
   url = data[:url]
   file = "/srv/tile.openstreetmap.org/data/#{File.basename(url)}"
-  directory = "/srv/tile.openstreetmap.org/data/#{data[:directory]}"
 
-  directory directory do
-    owner "tile"
-    group "tile"
-    mode 0o755
+  if data[:directory]
+    directory = "/srv/tile.openstreetmap.org/data/#{data[:directory]}"
+
+    directory directory do
+      owner "tile"
+      group "tile"
+      mode 0o755
+    end
+  else
+    directory = "/srv/tile.openstreetmap.org/data"
   end
 
   if file =~ /\.tgz$/