From 88fec38166f51bf8edabba6769a198016b799f1e Mon Sep 17 00:00:00 2001 From: Marcel Haerry Date: Mon, 27 Sep 2010 12:19:21 +0200 Subject: update templates to the new way --- manifests/register.pp | 43 ++++++++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 13 deletions(-) (limited to 'manifests/register.pp') diff --git a/manifests/register.pp b/manifests/register.pp index e1271e1..21f1d35 100644 --- a/manifests/register.pp +++ b/manifests/register.pp @@ -1,17 +1,34 @@ -define munin::register() +define munin::register ( + $host = 'absent', + $port = 'absent', + $description = 'absent', + $config = [] +) { - $munin_port_real = $munin_port ? { '' => 4949, default => $munin_port } - $munin_host_real = $munin_host ? { - '' => $fqdn, - 'fqdn' => $fqdn, - default => $munin_host - } + $fhost = $name + $client_type = 'client' - @@file { "/var/lib/puppet/modules/munin/nodes/${name}_${munin_port_real}": - ensure => present, - content => template("munin/defaultclient.erb"), - tag => 'munin', - } -} + $munin_port_real = $port ? { + 'absent' => $munin_port ? { + '' => 4949, + default => $munin_port + }, + default => $port + } + $munin_host_real = $host ? { + 'absent' => $munin_host ? { + '' => $fqdn, + 'fqdn' => $fqdn, + default => $munin_host + }, + default => $host + } + @@file { "munin_client_${fhost}_${munin_port_real}": + ensure => present, + path => "/var/lib/puppet/modules/munin/nodes/${fhost}_${munin_port_real}", + content => template("munin/client.erb"), + tag => 'munin', + } +} -- cgit v1.2.3 From 9b0b698523987b7631478bcf7dc84acf5e0e719c Mon Sep 17 00:00:00 2001 From: Marcel Haerry Date: Thu, 4 Aug 2011 10:48:57 +0200 Subject: move from concatenated_file to concat --- manifests/register.pp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'manifests/register.pp') diff --git a/manifests/register.pp b/manifests/register.pp index 21f1d35..78d13d3 100644 --- a/manifests/register.pp +++ b/manifests/register.pp @@ -25,9 +25,8 @@ define munin::register ( default => $host } - @@file { "munin_client_${fhost}_${munin_port_real}": - ensure => present, - path => "/var/lib/puppet/modules/munin/nodes/${fhost}_${munin_port_real}", + @@concat::fragment{ "munin_client_${fhost}_${munin_port_real}": + target => '/etc/munin/munin.conf', content => template("munin/client.erb"), tag => 'munin', } -- cgit v1.2.3 From 9b161f0c61bbd30960e663eceef8f1b35f633507 Mon Sep 17 00:00:00 2001 From: mh Date: Sat, 5 Nov 2011 14:14:32 +0100 Subject: use hiera to configure munin node specific things --- manifests/register.pp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'manifests/register.pp') diff --git a/manifests/register.pp b/manifests/register.pp index 78d13d3..3c542ff 100644 --- a/manifests/register.pp +++ b/manifests/register.pp @@ -9,18 +9,16 @@ define munin::register ( $client_type = 'client' $munin_port_real = $port ? { - 'absent' => $munin_port ? { - '' => 4949, - default => $munin_port - }, + 'absent' => hiera('munin_port','4949'), default => $port } + $hiera_munin_host = hiera('munin_host','') $munin_host_real = $host ? { - 'absent' => $munin_host ? { + 'absent' => $hiera_munin_host ? { '' => $fqdn, 'fqdn' => $fqdn, - default => $munin_host + default => $hiera_munin_host }, default => $host } -- cgit v1.2.3 From e2dfae5852ecdf3695a6af8ec48092ea24698390 Mon Sep 17 00:00:00 2001 From: "Christian G. Warden" Date: Thu, 2 Feb 2012 18:10:14 -0800 Subject: Fully qualify facter variables --- manifests/register.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'manifests/register.pp') diff --git a/manifests/register.pp b/manifests/register.pp index 3c542ff..254eaaf 100644 --- a/manifests/register.pp +++ b/manifests/register.pp @@ -16,8 +16,8 @@ define munin::register ( $hiera_munin_host = hiera('munin_host','') $munin_host_real = $host ? { 'absent' => $hiera_munin_host ? { - '' => $fqdn, - 'fqdn' => $fqdn, + '' => $::fqdn, + 'fqdn' => $::fqdn, default => $hiera_munin_host }, default => $host -- cgit v1.2.3 From 9fd1de5acd9064a0d67ca9d2c13a829a3f628f39 Mon Sep 17 00:00:00 2001 From: mh Date: Tue, 5 Jun 2012 19:39:49 -0300 Subject: new style for 2.7 --- manifests/register.pp | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'manifests/register.pp') diff --git a/manifests/register.pp b/manifests/register.pp index 254eaaf..14019d0 100644 --- a/manifests/register.pp +++ b/manifests/register.pp @@ -5,27 +5,27 @@ define munin::register ( $config = [] ) { - $fhost = $name - $client_type = 'client' + $fhost = $name + $client_type = 'client' - $munin_port_real = $port ? { - 'absent' => hiera('munin_port','4949'), - default => $port - } + $munin_port_real = $port ? { + 'absent' => hiera('munin_port','4949'), + default => $port + } - $hiera_munin_host = hiera('munin_host','') - $munin_host_real = $host ? { - 'absent' => $hiera_munin_host ? { - '' => $::fqdn, - 'fqdn' => $::fqdn, - default => $hiera_munin_host - }, - default => $host - } + $hiera_munin_host = hiera('munin_host','') + $munin_host_real = $host ? { + 'absent' => $hiera_munin_host ? { + '' => $::fqdn, + 'fqdn' => $::fqdn, + default => $hiera_munin_host + }, + default => $host + } - @@concat::fragment{ "munin_client_${fhost}_${munin_port_real}": - target => '/etc/munin/munin.conf', - content => template("munin/client.erb"), - tag => 'munin', - } + @@concat::fragment{ "munin_client_${fhost}_${munin_port_real}": + target => '/etc/munin/munin.conf', + content => template("munin/client.erb"), + tag => 'munin', + } } -- cgit v1.2.3 From c95f0b2fcf4f35b1a7ae3ad9c04600a32ab2bb43 Mon Sep 17 00:00:00 2001 From: mh Date: Wed, 13 Jun 2012 20:40:57 -0300 Subject: migrate away from hiera stuff --- manifests/register.pp | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) (limited to 'manifests/register.pp') diff --git a/manifests/register.pp b/manifests/register.pp index 14019d0..2645542 100644 --- a/manifests/register.pp +++ b/manifests/register.pp @@ -1,6 +1,6 @@ define munin::register ( - $host = 'absent', - $port = 'absent', + $host = $::fqdn, + $port = '4949', $description = 'absent', $config = [] ) @@ -8,21 +8,6 @@ define munin::register ( $fhost = $name $client_type = 'client' - $munin_port_real = $port ? { - 'absent' => hiera('munin_port','4949'), - default => $port - } - - $hiera_munin_host = hiera('munin_host','') - $munin_host_real = $host ? { - 'absent' => $hiera_munin_host ? { - '' => $::fqdn, - 'fqdn' => $::fqdn, - default => $hiera_munin_host - }, - default => $host - } - @@concat::fragment{ "munin_client_${fhost}_${munin_port_real}": target => '/etc/munin/munin.conf', content => template("munin/client.erb"), -- cgit v1.2.3 From a3e8f8ed1861d0a253b1605557e195f2530c2ae8 Mon Sep 17 00:00:00 2001 From: mh Date: Sun, 24 Jun 2012 19:21:41 -0400 Subject: correct naming --- manifests/register.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'manifests/register.pp') diff --git a/manifests/register.pp b/manifests/register.pp index 2645542..9257ca1 100644 --- a/manifests/register.pp +++ b/manifests/register.pp @@ -8,7 +8,7 @@ define munin::register ( $fhost = $name $client_type = 'client' - @@concat::fragment{ "munin_client_${fhost}_${munin_port_real}": + @@concat::fragment{ "munin_client_${fhost}_${port}": target => '/etc/munin/munin.conf', content => template("munin/client.erb"), tag => 'munin', -- cgit v1.2.3 From a2004f577c2e15d9b6cf482f0693601f43c43fad Mon Sep 17 00:00:00 2001 From: Markus Heberling Date: Wed, 23 Jan 2013 20:15:52 +0100 Subject: added support for use_ssh for munin 2.0 --- manifests/register.pp | 1 + 1 file changed, 1 insertion(+) (limited to 'manifests/register.pp') diff --git a/manifests/register.pp b/manifests/register.pp index 9257ca1..6c154e5 100644 --- a/manifests/register.pp +++ b/manifests/register.pp @@ -1,6 +1,7 @@ define munin::register ( $host = $::fqdn, $port = '4949', + $use_ssh = false, $description = 'absent', $config = [] ) -- cgit v1.2.3 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/register.pp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'manifests/register.pp') 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