]> gitweb.fluxo.info Git - puppet-nodo.git/commitdiff
Managing local encrypted backup
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 24 Jan 2013 23:12:21 +0000 (21:12 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 24 Jan 2013 23:12:21 +0000 (21:12 -0200)
manifests/nodo.pp

index 6259cd3a02157fa5d6fb1dce205acfaee7dd6073..64f25928994b86edec37f6b603506937b5fa60c7 100644 (file)
@@ -16,8 +16,31 @@ class nodo {
     class { 'puppetd': }
   }
 
+  #
+  # Backup
+  #
   class { 'backup': }
 
+  $local_backup = hiera('nodo::backup::localhost', false)
+
+  # Local encrypted backup
+  case $local_backup {
+    true,enabled,present: {
+      backup::duplicity { "localhost":
+        encryptkey => hiera('nodo::backup::encryptkey'),
+        password   => hiera('nodo::backup::password'),
+      }
+    }
+    absent {
+      backup::duplicity { "localhost":
+        encryptkey => hiera('nodo::backup::encryptkey'),
+        password   => hiera('nodo::backup::password'),
+        ensure     => absent,
+      }
+    }
+    default { }
+  }
+
   # Does not work well inside vservers
   class { 'runit': ensure => absent }