- user { "${user[username]}:${user[userid]}":
- name => $user[username],
- uid => $user[userid],
- ensure => "present",
- groups => $user[groups],
- managehome => true,
- system => !!$user[system],
- home => "/home/${user[username]}",
- notify => Exec["remove_password:${user[username]}:${user[userid]}"],
- purge_ssh_keys => true
- }
+ if ($user["username"] != "root") {
+ unless $user["shell"] == undef or empty($user["shell"]) {
+ ensure_packages([$user["shell"]])
+ $shell = "/bin/${user[shell]}"
+ } else {
+ $shell = undef
+ }
+
+ user { "${user[username]}:${user[userid]}":
+ name => $user[username],
+ uid => $user[userid],
+ ensure => "present",
+ groups => $user[groups],
+ managehome => true,
+ system => !!$user[system],
+ home => "/home/${user[username]}",
+ shell => $shell,
+ notify => Exec["remove_password:${user[username]}:${user[userid]}"],
+ purge_ssh_keys => true
+ }