From 51b6a1066d0b46944b2231d3c75e904070a6fc1a Mon Sep 17 00:00:00 2001 From: Joshua Hoblitt Date: Thu, 25 Apr 2013 14:28:38 -0700 Subject: [PATCH] add param $enable_monit to class smartd Used to enable/disable automatic declaration of a monit::monitor resource. Default is false. --- manifests/defaults.pp | 1 + manifests/init.pp | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/manifests/defaults.pp b/manifests/defaults.pp index c564bdf..a2446dd 100644 --- a/manifests/defaults.pp +++ b/manifests/defaults.pp @@ -7,6 +7,7 @@ $device_opts = {} $mail_to = 'root' $schedule = 'daily' # other choices: once, diminishing + $enable_monit = false case $::osfamily { 'FreeBSD': { diff --git a/manifests/init.pp b/manifests/init.pp index aaf2b11..ea50f09 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -8,6 +8,7 @@ $device_opts = $smartd::defaults::device_opts, $mail_to = $smartd::defaults::mail_to, $schedule = $smartd::defaults::schedule, + $enable_monit = $smartd::defaults::enable_monit, ) inherits smartd::defaults { case $ensure { 'present': { @@ -65,9 +66,11 @@ } # Let monit monitor smartd, if configured. - @monit::monitor {$service_name: - pidfile => "/var/run/${service_name}.pid", - ensure => $file_present, - tag => 'default', + if $enable_monit { + @monit::monitor {$service_name: + pidfile => "/var/run/${service_name}.pid", + ensure => $file_present, + tag => 'default', + } } }