Skip to content

Commit

Permalink
ensure service is stopped, if package_ensure is set to absent
Browse files Browse the repository at this point in the history
  • Loading branch information
saz committed Sep 29, 2013
1 parent 5be929b commit 260cd78
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand All @@ -34,7 +40,7 @@
}

service { $memcached::params::service_name:
ensure => running,
ensure => $service_ensure,
enable => true,
hasrestart => true,
hasstatus => $memcached::params::service_hasstatus,
Expand Down

0 comments on commit 260cd78

Please sign in to comment.