From adb5633e8d090fe4688f92e8ca5dfbb4ad8c3feb Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Fri, 27 Nov 2020 10:50:07 +0000 Subject: [PATCH] Sort addresses for stability --- cookbooks/nominatim/recipes/default.rb | 4 ++-- cookbooks/nominatim/templates/default/nginx.erb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cookbooks/nominatim/recipes/default.rb b/cookbooks/nominatim/recipes/default.rb index fc6d2e9e3..285d795f1 100644 --- a/cookbooks/nominatim/recipes/default.rb +++ b/cookbooks/nominatim/recipes/default.rb @@ -412,7 +412,7 @@ nginx_site "default" do action [:delete] end -frontends = search(:node, "recipes:web\\:\\:frontend") +frontends = search(:node, "recipes:web\\:\\:frontend").sort_by(&:name) nginx_site "nominatim" do template "nginx.erb" @@ -463,5 +463,5 @@ fail2ban_jail "nominatim_limit_req" do logpath "#{node[:nominatim][:logdir]}/nominatim.openstreetmap.org-error.log" ports [80, 443] maxretry 5 - ignoreips frontend_addresses.flatten + ignoreips frontend_addresses.flatten.sort end diff --git a/cookbooks/nominatim/templates/default/nginx.erb b/cookbooks/nominatim/templates/default/nginx.erb index df689304c..88bd3c909 100644 --- a/cookbooks/nominatim/templates/default/nginx.erb +++ b/cookbooks/nominatim/templates/default/nginx.erb @@ -49,7 +49,7 @@ map $http_referer $missing_referer { geo $whitelisted { default 0; <% @frontends.each do |frontend| -%> -<% frontend.ipaddresses(:role => :external) do |address| -%> +<% frontend.ipaddresses(:role => :external).sort.each do |address| -%> <%= address %> 1; <% end -%> <% end -%> -- 2.39.5