summaryrefslogtreecommitdiff
path: root/sitemodules/profiles/manifests/base.pp
diff options
context:
space:
mode:
Diffstat (limited to 'sitemodules/profiles/manifests/base.pp')
-rw-r--r--sitemodules/profiles/manifests/base.pp23
1 files changed, 14 insertions, 9 deletions
diff --git a/sitemodules/profiles/manifests/base.pp b/sitemodules/profiles/manifests/base.pp
index d1d709b..9c09881 100644
--- a/sitemodules/profiles/manifests/base.pp
+++ b/sitemodules/profiles/manifests/base.pp
@@ -37,24 +37,29 @@ class profiles::base (
# ensure admin users for this container
$admins.each |String $username| {
$user = $users[$username]
+ $osusername = $user['username']
group { $user['username']:
ensure => present,
} ->
- user { $user['username']:
- ensure => present,
- comment => $user['fullname'],
- gid => $user['username'],
- groups => ['sudo', 'adm'],
- password => $user['password'],
- uid => $user['uid'],
+ user { $osusername:
+ ensure => present,
+ comment => $user['fullname'],
+ gid => $osusername,
+ groups => ['sudo', 'adm'],
+ password => $user['password'],
+ uid => $user['uid'],
+ home => "/home/${osusername}",
+ purge_ssh_keys => true,
+ managehome => true,
}
$user['ssh_keys'].each |Hash[String, Data] $keydata| {
- ssh_authorized_key { "$user['username']@$keydata['name']":
+ $keyname = $keydata['name']
+ ssh_authorized_key { "${osusername}@${keyname}":
ensure => present,
user => $user['username'],
type => $keydata['type'],
key => $keydata['key'],
- require => User[$user['username']],
+ require => User[$osusername],
}
}
}