]> gitweb.fluxo.info Git - puppet-etherpad.git/commitdiff
Fixing requirements when the service is absent (3)
authorSilvio Rhatto <rhatto@riseup.net>
Sun, 9 Mar 2014 18:21:41 +0000 (15:21 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sun, 9 Mar 2014 18:21:41 +0000 (15:21 -0300)
manifests/init.pp

index b9096865e2e7c89d8502ac0433956cadb4703a4a..9dee68060b3d451dcf589b57227aebc4a6a9d568 100644 (file)
@@ -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':