diff options
author | Keith Burdis <keith@burdis.org> | 2013-02-09 08:51:44 +0000 |
---|---|---|
committer | Keith Burdis <keith@burdis.org> | 2013-02-09 08:51:44 +0000 |
commit | 0769984c3e3fbac826332420c044b691b5d11f8b (patch) | |
tree | e3153d18e9153c2125634902da14eb10c3499673 /manifests/hostgroup.pp | |
parent | 07b0b601cfb9ad4224e3b65fccb736bc5c93f41d (diff) |
* 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
Diffstat (limited to 'manifests/hostgroup.pp')
-rw-r--r-- | manifests/hostgroup.pp | 10 |
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], } } |