summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2014-03-09 15:21:41 -0300
committerSilvio Rhatto <rhatto@riseup.net>2014-03-09 15:21:41 -0300
commit4c07b9c3c29e845ac7c5d3a66cdc80a223b7b54f (patch)
treea8612251e52a8d96e1cd289ecb29b9e17268d11c
parentb9c9a3b9c7b7b54224a509a376435858db255399 (diff)
downloadpuppet-etherpad-4c07b9c3c29e845ac7c5d3a66cdc80a223b7b54f.tar.gz
puppet-etherpad-4c07b9c3c29e845ac7c5d3a66cdc80a223b7b54f.tar.bz2
Fixing requirements when the service is absent (3)
-rw-r--r--manifests/init.pp12
1 files changed, 10 insertions, 2 deletions
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':