Teach tilecache cookbook to return caches sorted (deterministic)
authorGrant Slater <git@firefishy.com>
Thu, 20 Jun 2013 16:25:06 +0000 (17:25 +0100)
committerGrant Slater <git@firefishy.com>
Thu, 20 Jun 2013 16:25:06 +0000 (17:25 +0100)
cookbooks/tilecache/recipes/default.rb
cookbooks/tilecache/templates/default/squid.conf.erb

index 23edf015557950d6065b7e6db4c3be5b16b2ed97..5b44be21f313db1cb067862da07f61062bd50b13 100644 (file)
@@ -19,7 +19,7 @@
 
 include_recipe "squid"
 
-tilecaches = search(:node, "roles:tilecache")
+tilecaches = search(:node, "roles:tilecache").sort_by { |n| n[:hostname] }
 
 squid_fragment "tilecache" do
   template "squid.conf.erb"
index aac9a45bcd0f34f9dcff02ea3561d6dd3316dd52..e2f74b6e83fbe976ae618eaadc3e243165e1a00c 100644 (file)
@@ -20,7 +20,7 @@ cache_peer_access osmtileFileAccel deny all
 acl pool_unlimited src 127.0.0.1
 <% @caches.each do |cache| -%>
 <% cache.ipaddresses(:family => :inet, :role => :external) do |address| -%>
-  acl pool_unlimited src <%= address %>
+acl pool_unlimited src <%= address %>
 <% end -%>
 <% end -%>