summaryrefslogtreecommitdiff
path: root/manifests/hostgroup.pp
blob: 756ef50211568fc146b7d144a11a58ea6caf2e5d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
define check_mk::hostgroup (
  $dir,
  $hostgroups,
  $target,
) {
  $group = $title
  $group_tags = join($hostgroups[$group], ',')
  concat::fragment { "check_mk-hostgroup-${host}":
    target  => $target,
    content => "  ( '${group}', [ ${group_tags} ], ALL_HOSTS ),\n",
    order   => 21,
  }
  file { "${dir}/${group}.cfg":
    ensure  => present,
    content => "define hostgroup {\n  hostgroup_name ${group}\n}\n",
    require => File[$dir],
  }
}