Skip to content

Commit

Permalink
add param $enable_monit to class smartd
Browse files Browse the repository at this point in the history
Used to enable/disable automatic declaration of a monit::monitor resource.  Default is false.
  • Loading branch information
Joshua Hoblitt committed Apr 25, 2013
1 parent f8b56a9 commit 51b6a10
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions manifests/defaults.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
$device_opts = {}
$mail_to = 'root'
$schedule = 'daily' # other choices: once, diminishing
$enable_monit = false

case $::osfamily {
'FreeBSD': {
Expand Down
11 changes: 7 additions & 4 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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': {
Expand Down Expand Up @@ -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',
}
}
}

0 comments on commit 51b6a10

Please sign in to comment.