summaryrefslogtreecommitdiff
path: root/manifests/hostgroup.pp
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/hostgroup.pp')
-rw-r--r--manifests/hostgroup.pp18
1 files changed, 18 insertions, 0 deletions
diff --git a/manifests/hostgroup.pp b/manifests/hostgroup.pp
new file mode 100644
index 0000000..756ef50
--- /dev/null
+++ b/manifests/hostgroup.pp
@@ -0,0 +1,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],
+ }
+}