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/client.pp | 2 +- manifests/host.pp | 40 +++++++++++++++++++--------------------- manifests/init.pp | 5 ----- manifests/register.pp | 5 ++--- manifests/register/snmp.pp | 5 ++--- 5 files changed, 24 insertions(+), 33 deletions(-) (limited to 'manifests') diff --git a/manifests/client.pp b/manifests/client.pp index 273070d..141c916 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -3,7 +3,7 @@ # See LICENSE for the full license granted to you. # Adapted and improved by admin(at)immerda.ch -class munin::client inherits munin { +class munin::client { $munin_port_real = $munin_port ? { '' => 4949, default => $munin_port } $munin_host_real = $munin_host ? { diff --git a/manifests/host.pp b/manifests/host.pp index 3e4f5ea..107cd39 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -2,32 +2,30 @@ # Copyright (C) 2007 David Schmitt # See LICENSE for the full license granted to you. -class munin::host inherits munin -{ - package {"munin": ensure => installed, } +class munin::host { + package {"munin": ensure => installed, } - File <<| tag == 'munin' |>> + Concat::Fragment <<| tag == 'munin' |>> - file{'/etc/munin/munin.conf.header': - source => [ "puppet:///modules/site-munin/config/host/${fqdn}/munin.conf.header", - "puppet:///modules/site-munin/config/host/munin.conf.header.$operatingsystem", - "puppet:///modules/site-munin/config/host/munin.conf.header", - "puppet:///modules/munin/config/host/munin.conf.header.$operatingsystem", - "puppet:///modules/munin/config/host/munin.conf.header" ], - notify => Exec['concat_/etc/munin/munin.conf'], - owner => root, group => 0, mode => 0644; - } + concat::fragment{'munin.conf.header': + target => '/etc/munin/munin.conf', + source => [ "puppet:///modules/site-munin/config/host/${fqdn}/munin.conf.header", + "puppet:///modules/site-munin/config/host/munin.conf.header.$operatingsystem", + "puppet:///modules/site-munin/config/host/munin.conf.header", + "puppet:///modules/munin/config/host/munin.conf.header.$operatingsystem", + "puppet:///modules/munin/config/host/munin.conf.header" ], + order => 05, + } - concatenated_file { "/etc/munin/munin.conf": - dir => '/var/lib/puppet/modules/munin/nodes', - header => "/etc/munin/munin.conf.header", - } + concat{ "/etc/munin/munin.conf": + owner => root, group => 0, mode => 0644; + } - include munin::plugins::muninhost + include munin::plugins::muninhost - if $munin_do_cgi_graphing { - include munin::host::cgi - } + if $munin_do_cgi_graphing { + include munin::host::cgi + } # from time to time we cleanup hanging munin-runs file{'/etc/cron.d/munin_kill': diff --git a/manifests/init.pp b/manifests/init.pp index bae83a4..b015521 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -14,8 +14,3 @@ # # the port is a parameter so vservers can share # IP addresses and still be happy - -class munin { - include common::moduledir - module_dir { [ "munin", "munin/nodes", "munin/plugins" ]: } -} 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', } diff --git a/manifests/register/snmp.pp b/manifests/register/snmp.pp index 0c3ac5c..5a1f42d 100644 --- a/manifests/register/snmp.pp +++ b/manifests/register/snmp.pp @@ -13,9 +13,8 @@ define munin::register::snmp ( unless => "ls /etc/munin/plugins/snmp_${fhost}_* &> /dev/null", } - @@file { "munin_snmp_${fhost}": - ensure => present, - path => "/var/lib/puppet/modules/munin/nodes/${fhost}", + @@concat::fragment{ "munin_snmp_${fhost}": + target => '/etc/munin/munin.conf', content => template("munin/client.erb"), tag => 'munin', } -- cgit v1.2.3