summaryrefslogtreecommitdiff
path: root/manifests/hostgroup.pp
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/hostgroup.pp')
-rw-r--r--manifests/hostgroup.pp10
1 files changed, 8 insertions, 2 deletions
diff --git a/manifests/hostgroup.pp b/manifests/hostgroup.pp
index ac66a16..baec45f 100644
--- a/manifests/hostgroup.pp
+++ b/manifests/hostgroup.pp
@@ -4,15 +4,21 @@ define check_mk::hostgroup (
$target,
) {
$group = $title
- $group_tags = join($hostgroups[$group], ',')
+ $group_tags = sprintf("'%s'", join($hostgroups[$group]['host_tags'], "', '"))
concat::fragment { "check_mk-hostgroup-${group}":
target => $target,
content => " ( '${group}', [ ${group_tags} ], ALL_HOSTS ),\n",
order => 21,
}
+ if $hostgroups[$group]['description'] {
+ $description = $hostgroups[$group]['description']
+ }
+ else {
+ $description = regsubst($group, '_', ' ')
+ }
file { "${dir}/${group}.cfg":
ensure => present,
- content => "define hostgroup {\n hostgroup_name ${group}\n}\n",
+ content => "define hostgroup {\n hostgroup_name ${group}\n alias ${description}\n}\n",
require => File[$dir],
}
}