From 3b10e0eb3fabb19cc0fa9d66f5a8379ae96aeb6f Mon Sep 17 00:00:00 2001 From: Sander Hoentjen Date: Mon, 18 Mar 2013 14:56:44 +0100 Subject: Add support for specifying tags for exported resources This enables you to specify different servers for different clients. --- manifests/client.pp | 3 ++- manifests/client/base.pp | 13 +++++++------ manifests/host.pp | 5 +++-- manifests/register.pp | 7 ++++--- 4 files changed, 16 insertions(+), 12 deletions(-) (limited to 'manifests') diff --git a/manifests/client.pp b/manifests/client.pp index 6726836..2316bc9 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -9,7 +9,8 @@ class munin::client( $port = '4949', $use_ssh = false, $manage_shorewall = false, - $shorewall_collector_source = 'net' + $shorewall_collector_source = 'net', + $export_tag = 'munin' ) { case $::operatingsystem { openbsd: { include munin::client::openbsd } diff --git a/manifests/client/base.pp b/manifests/client/base.pp index 441198e..78398a9 100644 --- a/manifests/client/base.pp +++ b/manifests/client/base.pp @@ -15,13 +15,14 @@ class munin::client::base { mode => 0644, owner => root, group => 0, } munin::register { $::fqdn: - host => $munin::client::host ? { - '*' => $::fqdn, - default => $munin::client::host + host => $munin::client::host ? { + '*' => $::fqdn, + default => $munin::client::host }, - port => $munin::client::port, - use_ssh => $munin::client::use_ssh, - config => [ 'use_node_name yes', 'load.load.warning 5', 'load.load.critical 10'], + port => $munin::client::port, + use_ssh => $munin::client::use_ssh, + config => [ 'use_node_name yes', 'load.load.warning 5', 'load.load.critical 10'], + export_tag => $munin::client::export_tag, } include munin::plugins::base } diff --git a/manifests/host.pp b/manifests/host.pp index b828e35..05dcb5e 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -3,12 +3,13 @@ # See LICENSE for the full license granted to you. class munin::host( - $cgi_graphing = false + $cgi_graphing = false, + $export_tag = 'munin' ) { package {"munin": ensure => installed, } include concat::setup - Concat::Fragment <<| tag == 'munin' |>> + Concat::Fragment <<| tag == $export_tag |>> concat::fragment{'munin.conf.header': target => '/etc/munin/munin.conf', diff --git a/manifests/register.pp b/manifests/register.pp index 6c154e5..309c322 100644 --- a/manifests/register.pp +++ b/manifests/register.pp @@ -3,15 +3,16 @@ define munin::register ( $port = '4949', $use_ssh = false, $description = 'absent', - $config = [] + $config = [], + $export_tag = 'munin' ) { $fhost = $name $client_type = 'client' @@concat::fragment{ "munin_client_${fhost}_${port}": - target => '/etc/munin/munin.conf', + target => '/etc/munin/munin.conf', content => template("munin/client.erb"), - tag => 'munin', + tag => $export_tag, } } -- cgit v1.2.3