summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
Diffstat (limited to 'manifests')
-rw-r--r--manifests/client.pp5
-rw-r--r--manifests/init.pp16
-rw-r--r--manifests/plugin.pp25
3 files changed, 39 insertions, 7 deletions
diff --git a/manifests/client.pp b/manifests/client.pp
index 8305bf0..59b6980 100644
--- a/manifests/client.pp
+++ b/manifests/client.pp
@@ -51,6 +51,7 @@ class munin::client::base {
package { "munin-node": ensure => installed }
service { "munin-node":
ensure => running,
+ enable => true,
hasstatus => true,
hasrestart => true,
require => Package[munin-node],
@@ -59,6 +60,10 @@ class munin::client::base {
ensure => directory,
mode => 0755, owner => root, group => 0;
}
+ $real_munin_allow = $munin_allow ? {
+ '' => '127.0.0.1',
+ default => $munin_allow
+ }
file {"/etc/munin/munin-node.conf":
content => template("munin/munin-node.conf.$operatingsystem"),
mode => 0644, owner => root, group => 0,
diff --git a/manifests/init.pp b/manifests/init.pp
index 6b6cd08..b0c2ba1 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -1,9 +1,19 @@
+#
+# munin module
# munin.pp - everything a sitewide munin installation needs
# Copyright (C) 2007 David Schmitt <david@schmitt.edv-bus.at>
-# See LICENSE for the full license granted to you.
-# adapted by Puzzle ITC - haerry+puppet(at)puzzle.ch
+#
+# Copyright 2008, Puzzle ITC GmbH
+# Marcel Härry haerry+puppet(at)puzzle.ch
+# Simon Josi josi+puppet(at)puzzle.ch
+#
+# This program is free software; you can redistribute
+# it and/or modify it under the terms of the GNU
+# General Public License version 3 as published by
+# the Free Software Foundation.
#
-# the port is a parameter so vservers can share IP addresses and still be happy
+# the port is a parameter so vservers can share
+# IP addresses and still be happy
# Define where the individual nodes' configs are stored
$NODESDIR="/var/lib/puppet/modules/munin/nodes"
diff --git a/manifests/plugin.pp b/manifests/plugin.pp
index d24b580..76d12a0 100644
--- a/manifests/plugin.pp
+++ b/manifests/plugin.pp
@@ -45,11 +45,17 @@ define munin::plugin (
}
default: {
debug ( "munin_plugin: making $plugin using src: $plugin_src" )
+ if $require {
+ $real_require = [ $require, Package['munin-node'] ]
+ } else {
+ $real_require = Package['munin-node']
+ }
file { $plugin:
ensure => "${real_script_path}/${plugin_src}",
- require => Package['munin-node'],
+ require => $real_require,
notify => Service['munin-node'];
}
+
}
}
case $config {
@@ -69,6 +75,11 @@ define munin::plugin (
content => "[${name}]\n$config\n",
mode => 0644, owner => root, group => 0,
}
+ if $require {
+ File[$plugin_conf]{
+ require +> $require,
+ }
+ }
}
}
}
@@ -107,11 +118,17 @@ define munin::plugin::deploy ($source = '', $ensure = 'present', $config = '') {
file { "munin_plugin_${name}":
path => "$munin::plugin::scriptpaths::script_path/${name}",
source => "puppet://$server/$real_source",
- ensure => file,
+ require => Package['munin-node'],
mode => 0755, owner => root, group => 0;
}
-
- munin::plugin{$name: ensure => $ensure, config => $config }
+ if $require {
+ File["munin_plugin_${name}"]{
+ require +> $require,
+ }
+ munin::plugin{$name: ensure => $ensure, config => $config, require => $require }
+ } else {
+ munin::plugin{$name: ensure => $ensure, config => $config }
+ }
}
### clases for plugins