]> git.openstreetmap.org Git - chef.git/commitdiff
Sort addresses for stability
authorTom Hughes <tom@compton.nu>
Fri, 27 Nov 2020 10:50:07 +0000 (10:50 +0000)
committerTom Hughes <tom@compton.nu>
Fri, 27 Nov 2020 12:51:52 +0000 (12:51 +0000)
cookbooks/nominatim/recipes/default.rb
cookbooks/nominatim/templates/default/nginx.erb

index fc6d2e9e3d5408d439392b26886ecef807eabe3b..285d795f1c1212c5b885e7e5ba4eb6e2b66a079a 100644 (file)
@@ -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
index df689304c81c78945b8db3ce2ea9402459604c64..88bd3c90993e2962fb7107325444d933222b115d 100644 (file)
@@ -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 -%>