From 260cd785c178389079adb871fae114b1ddf9a22c Mon Sep 17 00:00:00 2001 From: Steffen Zieger Date: Mon, 30 Sep 2013 01:04:48 +0200 Subject: [PATCH] ensure service is stopped, if package_ensure is set to absent --- manifests/init.pp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/manifests/init.pp b/manifests/init.pp index 894085c23..fb4d88c2a 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -14,6 +14,12 @@ $install_dev = false ) inherits memcached::params { + if $package_ensure == 'absent' { + $service_ensure = 'stopped' + } else { + $service_ensure = 'running' + } + package { $memcached::params::package_name: ensure => $package_ensure, } @@ -34,7 +40,7 @@ } service { $memcached::params::service_name: - ensure => running, + ensure => $service_ensure, enable => true, hasrestart => true, hasstatus => $memcached::params::service_hasstatus,