summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Haerry <haerry@puzzle.ch>2011-08-04 10:48:57 +0200
committerMarcel Haerry <haerry@puzzle.ch>2011-08-04 10:48:57 +0200
commit9b0b698523987b7631478bcf7dc84acf5e0e719c (patch)
tree8d333ebe58802de2bda0e6ccfe94093bebf1b938
parent447041b01494690975d078776a85f4a3fd4e64fa (diff)
move from concatenated_file to concat
-rw-r--r--README5
-rw-r--r--manifests/client.pp2
-rw-r--r--manifests/host.pp40
-rw-r--r--manifests/init.pp5
-rw-r--r--manifests/register.pp5
-rw-r--r--manifests/register/snmp.pp5
6 files changed, 27 insertions, 35 deletions
diff --git a/README b/README
index 5964b21..7ea6e44 100644
--- a/README
+++ b/README
@@ -5,8 +5,9 @@ a very easy plugin interface. The munin homepage is http://munin.projects.linpro
To use this module, follow these directions:
-1. Install the "common" module -- the munin module depends on functions that are
- defined and installed via the common module, see README.common for how to do this
+1. Install the "common" and "concat" module -- the munin module depends on functions
+ that are defined and installed via these modulesh, see README.common for how to do
+ this
2. You will need storedconfigs enabled in your puppet setup, to do that you need to
add a line to your puppet.conf in your [puppetmasterd] section which says:
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 <david@schmitt.edv-bus.at>
# 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',
}