1 class base_installation::users (
2 $users = $base_installation::system_users,
3 ) inherits base_installation {
4 ensure_packages('ruby-shadow')
7 purge_ssh_keys => ["/root/.ssh/authorized_keys"],
11 config_file_replace => false,
12 # Missing in the sudo package, should no be mandatory
18 content => "%wheel ALL=(ALL) ALL"
24 if ($user["username"] != "root") {
25 user { "${user[username]}:${user[userid]}":
26 name => $user[username],
29 groups => $user[groups],
31 system => !!$user[system],
32 home => "/home/${user[username]}",
33 notify => Exec["remove_password:${user[username]}:${user[userid]}"],
34 purge_ssh_keys => true
37 exec { "remove_password:${user[username]}:${user[userid]}":
38 command => "/usr/bin/chage -d 0 ${user[username]} && /usr/bin/passwd -d ${user[username]}",
39 onlyif => "/usr/bin/test -z '${user[password]}'",
44 if has_key($user, "keys") {
45 $user[keys].each |$key| {
46 if has_key($key, "command") {
47 ssh_authorized_key { "${user[username]}@${key[host]}":
48 name => "${user[username]}@${key[host]}",
49 user => $user[username],
50 type => $key[key_type],
53 "command=\"${key[command]}\"",
60 ssh_authorized_key { "${user[username]}@${key[host]}":
61 name => "${user[username]}@${key[host]}",
62 user => $user[username],
63 type => $key[key_type],