]> git.openstreetmap.org Git - chef.git/commitdiff
Include internal addresses in munin allow list
authorTom Hughes <tom@compton.nu>
Tue, 28 Mar 2023 20:09:12 +0000 (20:09 +0000)
committerTom Hughes <tom@compton.nu>
Tue, 28 Mar 2023 20:11:40 +0000 (21:11 +0100)
cookbooks/munin/recipes/default.rb
cookbooks/munin/templates/default/munin-node.conf.erb

index a54b387185fdde2a413b0db111b050cd29cde13c..9b2c6f294776195a57813c1841cba5eb7567f178 100644 (file)
@@ -24,9 +24,7 @@ service "munin-node" do
   supports :status => true, :restart => true, :reload => true
 end
 
-servers = search(:node, "recipes:munin\\:\\:server").collect do |server|
-  server.ipaddresses(:role => :external)
-end.flatten
+servers = search(:node, "recipes:munin\\:\\:server").map(&:ipaddresses).flatten
 
 firewall_rule "accept-munin" do
   action :accept
index f2e09d7e9cd61219d6997a34aef56e382be5f0e2..6bd38df19690ca22fdc8304bfac52323c8964fd9 100644 (file)
@@ -31,7 +31,7 @@ port 4949
 
 # List the addresses that are allowed to connect
 allow ^127\.0\.0\.1$
-<% @servers.each do |server| -%>
+<% @servers.sort.each do |server| -%>
 allow ^<%= Regexp.quote(server) %>$
 <% end -%>
 <% node[:munin][:allow].each do |address| -%>