summaryrefslogtreecommitdiff
path: root/puppet/modules/site_check_mk/templates/hostgroups.mk
blob: 7158dcd1ef4756a3364b914d3aa5a4e5c4cad69c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<%
  host_groups = []
  @environments.keys.sort.each do |env_name|
    hosts = ""
    @nagios_hosts.keys.sort.each do |hostname|
      hostdata = @nagios_hosts[hostname]
      domain_internal = hostdata['domain_internal']
      if hostdata['environment'] == env_name
        hosts << '"' + domain_internal + '", '
      end
    end
    host_groups << '  ( "%s", [%s] )' % [env_name, hosts]
  end
%>
host_groups = [
<%= host_groups.join(",\n") %>
]