]> gitweb.fluxo.info Git - puppet-backup.git/commitdiff
Fixes backup::user
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 23 Jun 2016 17:57:28 +0000 (14:57 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 23 Jun 2016 17:57:28 +0000 (14:57 -0300)
manifests/user.pp

index 4b60f9770cc1f6c74062f27a2b8916bf010bcd4c..9c63c22381dae0fa60f6a8f0405e0e0744ddd186 100644 (file)
@@ -1,9 +1,15 @@
 # Inspired by backupninja::sandbox
-class backup::user(
+define backup::user(
   $ensure         = present,
   $hosting_domain = $::domain,
-  $sshkey         = hiera("compiled::ssh::key::${name}.${hosting_domain}"),
+  $sshkey         = '',
 ) {
+  #$hosting_domain = regsubst($::domain, '\.', '_', 'G'),
+  $real_sshkey = $sshkey ? {
+    ''      => hiera("compiled::ssh::key::${name}.${hosting_domain}"),
+    default => $sshkey,
+  }
+
   user::manage { $name:
     ensure   => $ensure,
     password => '*',
@@ -11,6 +17,6 @@ class backup::user(
     gid      => 'backupninjas',
     shell    => '/bin/bash',
     homedir  => "${::backup::params::backupdir_remote}/${name}.${hosting_domain}",
-    sshkey   => $sshkey,
+    sshkey   => $real_sshkey,
   }
 }