Skip to content

Commit

Permalink
[COOK-500] Sort the list of munin servers and clients to prevent
Browse files Browse the repository at this point in the history
needless changes in the output files when a search returns the same
set of results in a different order across runs.
  • Loading branch information
jimbrowne authored and jtimberman committed Oct 28, 2011
1 parent 83b5fb0 commit 5aa9ec4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions munin/recipes/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#

munin_servers = search(:node, "munin:[* TO *] AND chef_environment:#{node.chef_environment}")
munin_servers.sort! { |a,b| a[:fqdn] <=> b[:fqdn] }

if node[:public_domain]
case node.chef_environment
Expand Down
2 changes: 1 addition & 1 deletion munin/templates/default/munin-node.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ host_name <%= node[:hostname] %>.ec2.internal
# doesn't understand CIDR-style network notation. You may repeat
# the allow line as many times as you'd like

<% @munin_servers.each do |server| -%>
<% @munin_servers.sort.each do |server| -%>
allow ^<%= server[:ipaddress].to_s.gsub(/\./, '\.') %>$
<% end -%>
allow ^127\.0\.0\.1$
Expand Down

0 comments on commit 5aa9ec4

Please sign in to comment.