From: Silvio Rhatto Date: Sun, 9 Mar 2014 18:21:41 +0000 (-0300) Subject: Fixing requirements when the service is absent (3) X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=4c07b9c3c29e845ac7c5d3a66cdc80a223b7b54f;p=puppet-etherpad.git Fixing requirements when the service is absent (3) --- diff --git a/manifests/init.pp b/manifests/init.pp index b909686..9dee680 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -76,12 +76,20 @@ class etherpad( require => Vcsrepo['/var/lib/etherpad-lite'], } + $directory = $ensure ? { + 'present' => 'directory', + default => 'absent', + } + file { '/var/log/etherpad-lite': - ensure => directory, + ensure => $directory, owner => 'etherpad-lite', group => 'etherpad-lite', mode => 0755, - require => [ User['etherpad-lite'], Group['etherpad-lite'] ], + require => $ensure ? { + present => [ User['etherpad-lite'], Group['etherpad-lite'] ], + default => undef, + }, } file { '/etc/logrotate.d/etherpad-lite':