aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2017-12-30 00:25:24 -0200
committerSilvio Rhatto <rhatto@riseup.net>2017-12-30 00:25:24 -0200
commitef69b77ccada9e983cd8e79ed92c90a84a8ff9fe (patch)
treea57607c2ba06d073712c9b18ae591f6923e7a1ef
parenta0cf3162460993ce01a4b6c6fcd520c14c958332 (diff)
downloadpuppet-backup-ef69b77ccada9e983cd8e79ed92c90a84a8ff9fe.tar.gz
puppet-backup-ef69b77ccada9e983cd8e79ed92c90a84a8ff9fe.tar.bz2
Escaping dotted notation for sshkey lookup
-rw-r--r--manifests/user.pp12
1 files changed, 5 insertions, 7 deletions
diff --git a/manifests/user.pp b/manifests/user.pp
index eb303cb..3ada103 100644
--- a/manifests/user.pp
+++ b/manifests/user.pp
@@ -1,14 +1,12 @@
# Inspired by backupninja::sandbox
+#
+# Escaping dotted notation for sshkey lookup, see
+# https://puppet.com/docs/puppet/5.3/hiera_automatic.html#hiera-dotted-notation
define backup::user(
$ensure = present,
$hosting_domain = $::domain,
- $sshkey = '',
+ $sshkey = hiera("'ssh_authorized_key::${name}.${hosting_domain}'"),
) {
- $real_sshkey = $sshkey ? {
- '' => hiera("ssh_authorized_key::${name}.${hosting_domain}"),
- default => $sshkey,
- }
-
user::manage { $name:
ensure => $ensure,
password => '*',
@@ -16,6 +14,6 @@ define backup::user(
gid => 'backupninjas',
shell => '/bin/bash',
homedir => "${::backup::params::backupdir_remote}/${name}.${hosting_domain}",
- sshkey => $real_sshkey,
+ sshkey => $sshkey,
}
}