Skip to content

Commit

Permalink
Merge pull request sous-chefs#272 from mdxp/duplicate-roles-env
Browse files Browse the repository at this point in the history
prevent duplicates hostgroups in case the same roles/environment exist
  • Loading branch information
tas50 committed May 3, 2014
2 parents 50cde3e + a1709c1 commit 571f0b2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
# if using multi environment monitoring add all environments to the array of hostgroups
if node['nagios']['multi_environment_monitoring']
search(:environment, '*:*') do |e|
hostgroups << e.name
hostgroups << e.name unless hostgroups.include?(e.name)
nodes.select { |n| n.chef_environment == e.name }.each do |n|
service_hosts[e.name] = n[node['nagios']['host_name_attribute']]
end
Expand Down

0 comments on commit 571f0b2

Please sign in to comment.