]> gitweb.fluxo.info Git - puppet-nodo.git/commitdiff
Adds nodo::munin_node::manage
authorSilvio Rhatto <rhatto@riseup.net>
Mon, 26 Oct 2015 16:47:33 +0000 (14:47 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Mon, 26 Oct 2015 16:47:33 +0000 (14:47 -0200)
manifests/subsystem/monitor/munin.pp

index a3deb47ab6615c3cfc22317b4b22f9942f322ce0..c2f461ac7135c5890a0ca818eb8091ff17aff78d 100644 (file)
@@ -1,5 +1,6 @@
 # Define a munin node
 define nodo::subsystem::monitor::munin(
+  $manage        = hiera('nodo::munin_node::manage', True),
   $port          = hiera('nodo::munin_node::port',   '4949'),
   $allow         = hiera('nodo::munin_node::allow',  ''),
   $host          = hiera('nodo::munin_node::host',    $::fqdn),
@@ -7,21 +8,23 @@ define nodo::subsystem::monitor::munin(
   $config        = hiera('nodo::munin_node::config', [ 'use_node_name yes', 'load.load.warning 5', 'load.load.critical 10' ])
 ) {
 
-  case $allow {
-    '': { fail("Please set nodo::munin_node::allow in your config") }
-  }
+  if $manage == true {
+    case $allow {
+      '': { fail("Please set nodo::munin_node::allow in your config") }
+    }
 
-  package { "munin-plugins-extra":
-    ensure => "present",
-  }
+    package { "munin-plugins-extra":
+      ensure => "present",
+    }
 
-  class { 'munin::client':
-    port   => $port,
-    allow  => $allow,
-    host   => $host,
-    listen => $listen,
-    config => $config,
-  }
+    class { 'munin::client':
+      port   => $port,
+      allow  => $allow,
+      host   => $host,
+      listen => $listen,
+      config => $config,
+    }
 
-  munin::plugin { apt_all: ensure => present; }
+    munin::plugin { apt_all: ensure => present; }
+  }
 }