Skip to content

Commit

Permalink
set file ensure based on $package_ensure, fixes #149
Browse files Browse the repository at this point in the history
  • Loading branch information
saz committed Sep 1, 2023
1 parent a303edd commit a5ecd5b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,11 @@
if $package_ensure == 'absent' {
$service_ensure = 'stopped'
$service_enable = false
$file_ensure = 'absent'
} else {
$service_ensure = 'running'
$service_enable = true
$file_ensure = 'file'
}

if ! $listen and ! $listen_ip {
Expand Down Expand Up @@ -120,7 +122,7 @@

if ( $memcached::params::config_file ) {
file { $memcached::params::config_file:
ensure => 'file',
ensure => $file_ensure,
owner => 'root',
group => 0,
mode => '0644',
Expand All @@ -132,7 +134,7 @@

if $logfile and !$syslog {
file { $logfile:
ensure => 'file',
ensure => $file_ensure,
owner => $user,
group => 0,
mode => '0640',
Expand Down

0 comments on commit a5ecd5b

Please sign in to comment.