From 7ce3190986cf8e5fe037a7ccd4c1076505b117f4 Mon Sep 17 00:00:00 2001 From: Micah Date: Tue, 12 Jul 2016 16:41:59 -0400 Subject: remove submodules in preparation for move to subrepos Change-Id: Ia7655153b556337f676e3d909559c4a7306bedd6 --- puppet/modules/check_mk | 1 - 1 file changed, 1 deletion(-) delete mode 160000 puppet/modules/check_mk (limited to 'puppet/modules/check_mk/manifests/hostgroup.pp') diff --git a/puppet/modules/check_mk b/puppet/modules/check_mk deleted file mode 160000 index aa025715..00000000 --- a/puppet/modules/check_mk +++ /dev/null @@ -1 +0,0 @@ -Subproject commit aa02571537af90ac73309e6e216c9417802548c3 -- cgit v1.2.3 From 56a771a3008d10720dd05fd815aeafbacdd1e08e Mon Sep 17 00:00:00 2001 From: Micah Date: Tue, 12 Jul 2016 16:46:32 -0400 Subject: git subrepo clone https://leap.se/git/puppet_check_mk puppet/modules/check_mk subrepo: subdir: "puppet/modules/check_mk" merged: "aa02571" upstream: origin: "https://leap.se/git/puppet_check_mk" branch: "master" commit: "aa02571" git-subrepo: version: "0.3.0" origin: "https://github.com/ingydotnet/git-subrepo" commit: "1e79595" Change-Id: I6cb060eb80966dd6ae346f7a8105289caa9ccbaf --- puppet/modules/check_mk/manifests/hostgroup.pp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 puppet/modules/check_mk/manifests/hostgroup.pp (limited to 'puppet/modules/check_mk/manifests/hostgroup.pp') diff --git a/puppet/modules/check_mk/manifests/hostgroup.pp b/puppet/modules/check_mk/manifests/hostgroup.pp new file mode 100644 index 00000000..baec45f9 --- /dev/null +++ b/puppet/modules/check_mk/manifests/hostgroup.pp @@ -0,0 +1,24 @@ +define check_mk::hostgroup ( + $dir, + $hostgroups, + $target, +) { + $group = $title + $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 alias ${description}\n}\n", + require => File[$dir], + } +} -- cgit v1.2.3