X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/969e1e6d277ef40a24d2cdc33f31f1eaa48752f5..9fcfa1aacf134b9db294d03cd9b6ba9a1527f154:/cookbooks/munin/recipes/default.rb diff --git a/cookbooks/munin/recipes/default.rb b/cookbooks/munin/recipes/default.rb index c1233f9b9..9b2c6f294 100644 --- a/cookbooks/munin/recipes/default.rb +++ b/cookbooks/munin/recipes/default.rb @@ -24,20 +24,16 @@ service "munin-node" do supports :status => true, :restart => true, :reload => true end -servers = search(:node, "recipes:munin\\:\\:server") +servers = search(:node, "recipes:munin\\:\\:server").map(&:ipaddresses).flatten -servers.each do |server| - server.interfaces(:role => :external) do |interface| - firewall_rule "accept-munin-#{server}" do - action :accept - family interface[:family] - source "net:#{interface[:address]}" - dest "fw" - proto "tcp" - dest_ports "munin" - source_ports "1024-65535" - end - end +firewall_rule "accept-munin" do + action :accept + context :incoming + protocol :tcp + source servers + dest_ports "munin" + source_ports "1024-65535" + not_if { servers.empty? } end template "/etc/munin/munin-node.conf" do