]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/logstash/recipes/default.rb
Sort logstash server firewall rules by node name
[chef.git] / cookbooks / logstash / recipes / default.rb
index cf8405ff8605b8e83927f629290e6f5918d84581..3f2c98f91165cf1db973af63e27794d37cf2f5ad 100644 (file)
@@ -66,7 +66,7 @@ end
 
 forwarders = search(:node, "recipes:logstash\\:\\:forwarder") # ~FC010
 
-forwarders.each do |forwarder|
+forwarders.sort_by { |n| n[:fqdn] }.each do |forwarder|
   forwarder.interfaces(:role => :external) do |interface|
     firewall_rule "accept-lumberjack-#{forwarder}" do
       action :accept
@@ -82,7 +82,7 @@ end
 
 gateways = search(:node, "roles:gateway") # ~FC010
 
-gateways.each do |gateway|
+gateways.sort_by { |n| n[:fqdn] }.each do |gateway|
   gateway.interfaces(:role => :external) do |interface|
     firewall_rule "accept-lumberjack-#{gateway}" do
       action :accept