]> git.openstreetmap.org Git - chef.git/commitdiff
Sort tile cache addresses into a deterministic order (tile cookbook)
authorGrant Slater <git@firefishy.com>
Thu, 20 Jun 2013 16:35:17 +0000 (17:35 +0100)
committerTom Hughes <tom@compton.nu>
Thu, 20 Jun 2013 16:41:11 +0000 (17:41 +0100)
cookbooks/tile/recipes/default.rb
cookbooks/tile/templates/default/apache.erb

index 13ad6418d9cc584f01a0fd8154be1f4c799ba377..7b24c5c40b8629b59e25f0e9b7905a62292b54ca 100644 (file)
@@ -34,7 +34,7 @@ apache_module "tile" do
   conf "tile.conf.erb"
 end
 
-tilecaches = search(:node, "roles:tilecache")
+tilecaches = search(:node, "roles:tilecache").sort_by { |n| n[:hostname] }
 
 apache_site "default" do
   action [ :disable ]
index ba3b704c6e2f0d1c337b195de3d8ed23d66b0d38..1ffa2323d278997acb302431563a25d17f096168 100644 (file)
@@ -14,7 +14,7 @@
   # Get the real remote IP for requests via a trusted proxy
   RemoteIPHeader X-Forwarded-For
 <% @caches.each do |cache| -%>
-<% cache.ipaddresses(:role => :external) do |address| -%>
+<% cache.ipaddresses(:role => :external).sort.each do |address| -%>
   RemoteIPTrustedProxy <%= address %>
 <% end -%>
 <% end -%>