From 0769984c3e3fbac826332420c044b691b5d11f8b Mon Sep 17 00:00:00 2001 From: Keith Burdis Date: Sat, 9 Feb 2013 08:51:44 +0000 Subject: * Added host tags to agent config so that host groups can be auto-populated * Fixed incorrect package name when using a file store that was causing the package existence check to fail always causing an often failing reinstall * Enable a static list of hosts to be specified for those without the Puppet check_mk module installed --- manifests/hostgroup.pp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'manifests/hostgroup.pp') 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], } } -- cgit v1.2.3