# Hostgroup definitions
# Automatically generated by Chef

define hostgroup {
  hostgroup_name all
  alias all
  members *
}

<% @roles.each do |r| -%>
define hostgroup {
  hostgroup_name <%= r %>
  alias <%= r %>
}
<% end -%>

<% @environments.each do |e| -%>
define hostgroup {
  hostgroup_name <%= e %>
  alias <%= e %>
}
<% end -%>

<% if node['nagios']['multi_os_monitoring'] == true -%>
<% @os.each do |o| -%>
define hostgroup {
	hostgroup_name <%= o %>
	alias <%= o %>
}
<% end -%>
<% end -%>

# Hostgroup definitions
# Automatically generated by Chef

define hostgroup {
  hostgroup_name all
  alias all
  members *
}

<% @roles.each do |r| -%>
define hostgroup {
  hostgroup_name <%= r %>
  alias <%= r %>
}
<% end -%>

<% @environments.each do |e| -%>
define hostgroup {
  hostgroup_name <%= e %>
  alias <%= e %>
}
<% end -%>

<% if os.any? -%>
<% @os.each do |o| -%>
define hostgroup {
	hostgroup_name <%= o %>
	alias <%= o %>
}
<% end -%>
<% end -%>

Switch to any? to check if there are values in the OS array
Switch to any? to check if there are values in the OS array
