I have a define that looks like this:
define user::sys_user($fullname, $uid, $groups, $shell='/bin/bash', $authkey, $authkey_type=rsa) {
$username = "sys_${name}"
group { $username:
gid => $uid,
}
user { $username:
require => Group[$username],
ensure => present,
uid => $uid,
gid => $uid,
groups => $groups,
comment => $fullname,
shell => $shell,
managehome => true,
allowdupe => false,
}
ssh_authorized_key { "${username}_authkey":
user => $username,
ensure => present,
key => $authkey,
type => $authkey_type,
}
}
In the user
resource, I am requiring the user's default group. I also want to require supplemental groups if provided by the parameter $groups.
Also, is the way I do groups => $groups
going to fail if it's empty or if it's just a string (i.e., defines just one group instead of an array)?