1 class base_installation::users (
2 $users = $base_installation::system_users,
3 ) inherits base_installation {
4 ensure_packages('ruby-shadow')
10 config_file_replace => false,
11 # Missing in the sudo package, should no be mandatory
17 content => "%wheel ALL=(ALL) ALL"
23 user { "${user[username]}:${user[userid]}":
24 name => $user[username],
27 groups => $user[groups],
29 system => !!$user[system],
30 home => "/home/${user[username]}",
31 notify => Exec["remove_password:${user[username]}:${user[userid]}"],
32 purge_ssh_keys => true
35 exec { "remove_password:${user[username]}:${user[userid]}":
36 command => "/usr/bin/chage -d 0 ${user[username]} && /usr/bin/passwd -d ${user[username]}",
37 onlyif => "/usr/bin/test -z '${user[password]}'",
41 if has_key($user, "keys") {
42 $user[keys].each |$key| {
43 ssh_authorized_key { "${user[username]}@${key[host]}":
44 name => "${user[username]}@${key[host]}",
45 user => $user[username],
46 type => $key[key_type],