forwarders = []
-search(:node, "recipes:logstash\\:\\:forwarder").each do |forwarder|
- forwarder.interfaces(:role => :external).map do |interface|
- forwarders << interface[:address]
- end
-end
+forwarders << search(:node, "recipes:logstash\\:\\:forwarder").collect do |forwarder|
+ forwarder.ipaddresses(:role => :external)
+end.flatten
-search(:node, "roles:gateway").each do |forwarder|
- forwarder.interfaces(:role => :external).map do |interface|
- forwarders << interface[:address]
- end
-end
+forwarders << search(:node, "roles:gateway").collect do |forwarder|
+ forwarder.ipaddresses(:role => :external)
+end.flatten
firewall_rule "accept-logstash" do
action :accept
supports :status => true, :restart => true, :reload => true
end
-servers = []
-
-search(:node, "recipes:munin\\:\\:server").each do |server|
- server.interfaces(:role => :external) do |interface|
- servers << interface[:address]
- end
-end
+servers = search(:node, "recipes:munin\\:\\:server").collect do |server|
+ server.ipaddresses(:role => :external)
+end.flatten
firewall_rule "accept-munin" do
action :accept