]> gitweb.fluxo.info Git - puppet-backup.git/commitdiff
Password may not be specified if backup is absent
authorSilvio Rhatto <rhatto@riseup.net>
Fri, 24 Jun 2016 18:49:00 +0000 (15:49 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Fri, 24 Jun 2016 18:49:00 +0000 (15:49 -0300)
manifests/duplicity.pp

index 82f057d4585d1434c5dd4389dff813a6d349ad6e..2da5db18d81228e8825babe5a5e504f2523806f7 100644 (file)
@@ -11,8 +11,13 @@ define backup::duplicity(
     $directory             = "${backup::params::backupdir}/duplicity"
 ) {
 
-  case $encryptkey { false: { err("need to define a key!") } }
-  case $password { false: { err("need to define password!") } }
+  if $encryptkey == false and $ensure == 'present' {
+    err("need to define a key!")
+  }
+
+  if $password == false and $ensure == 'present' {
+    err("need to define password!")
+  }
 
   $exclude_unencrypted = $backup::params::exclude_unencrypted
   $include_unencrypted = $backup::params::include_unencrypted