From bd0f9c1ea94e5b786f67f1cf5ab39e056c092448 Mon Sep 17 00:00:00 2001 From: Grant Slater Date: Thu, 20 Jun 2013 17:35:17 +0100 Subject: [PATCH] Sort tile cache addresses into a deterministic order (tile cookbook) --- cookbooks/tile/recipes/default.rb | 2 +- cookbooks/tile/templates/default/apache.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cookbooks/tile/recipes/default.rb b/cookbooks/tile/recipes/default.rb index 13ad6418d..7b24c5c40 100644 --- a/cookbooks/tile/recipes/default.rb +++ b/cookbooks/tile/recipes/default.rb @@ -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 ] diff --git a/cookbooks/tile/templates/default/apache.erb b/cookbooks/tile/templates/default/apache.erb index ba3b704c6..1ffa2323d 100644 --- a/cookbooks/tile/templates/default/apache.erb +++ b/cookbooks/tile/templates/default/apache.erb @@ -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 -%> -- 2.43.2