diff options
Diffstat (limited to 'manifests/subsystem/monitor')
-rw-r--r-- | manifests/subsystem/monitor/master.pp | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/manifests/subsystem/monitor/master.pp b/manifests/subsystem/monitor/master.pp index d6f09b7..dc52391 100644 --- a/manifests/subsystem/monitor/master.pp +++ b/manifests/subsystem/monitor/master.pp @@ -7,16 +7,10 @@ class nodo::subsystem::monitor::master { require => Package['nagios'], } - $main = hiera('nodo::role::master::main', false) - - if $main == true { - $ensure = 'present' - $package = 'installed' - $service = 'running' - } else { - $ensure = 'absent' - $package = 'purged' - $service = 'stopped' + $main = hiera('nodo::role::master::main', false) + $ensure = $main ? { + true => 'present', + default => 'absent', } # @@ -25,7 +19,7 @@ class nodo::subsystem::monitor::master { # http://kuszelas.eu/~eyck/log/Howto/Munin.Rrdcached.html # package { 'rrdcached': - ensure => $package, + ensure => $ensure, } file { '/etc/default/rrdcached': @@ -37,8 +31,10 @@ class nodo::subsystem::monitor::master { notify => Service['rrdcached'], } - service { 'rrdcached': - ensure => $service, - require => Package['rrdcached'], + if $main == true { + service { 'rrdcached': + ensure => running, + require => Package['rrdcached'], + } } } |