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,