aboutsummaryrefslogtreecommitdiff
path: root/manifests/subsystem
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2014-03-07 18:35:57 -0300
committerSilvio Rhatto <rhatto@riseup.net>2014-03-07 18:35:57 -0300
commit0829cf1309d0027fae1227bd54c7efe4ae280191 (patch)
treeca7ae286cc136c2a6d3ca07bf462eb8a709bda08 /manifests/subsystem
parent23984ce0dec9f8587f546192af865fb91e92270b (diff)
downloadpuppet-nodo-0829cf1309d0027fae1227bd54c7efe4ae280191.tar.gz
puppet-nodo-0829cf1309d0027fae1227bd54c7efe4ae280191.tar.bz2
Cleanup on nodo::subsystem::monitor::master
Diffstat (limited to 'manifests/subsystem')
-rw-r--r--manifests/subsystem/monitor/master.pp24
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'],
+ }
}
}