Sort git server firewall rules by node name
authorTom Hughes <tom@compton.nu>
Sun, 16 Oct 2016 20:38:55 +0000 (21:38 +0100)
committerTom Hughes <tom@compton.nu>
Sun, 16 Oct 2016 20:38:55 +0000 (21:38 +0100)
cookbooks/git/recipes/server.rb

index c8077a3..e87575c 100644 (file)
@@ -29,7 +29,7 @@ directory git_directory do
 end
 
 if node[:git][:allowed_nodes]
-  search(:node, node[:git][:allowed_nodes]).each do |n|
+  search(:node, node[:git][:allowed_nodes]).sort_by { |n| n[:fqdn] }.each do |n|
     n.interfaces(:role => :external).each do |interface|
       firewall_rule "accept-git" do
         action :accept