While creating user we can specify group in gid to which he belongs and if this user belongs to multiple groups how can we specify in chef
user 'random' do
supports :manage_home => true
comment 'Random User'
uid 1234
gid 'users'
end
If user resource not providing this option how can we achieve in best way.
That's not a user which has multiple groups in fact, it'a group having multiple users (that's managed in
/etc/groups
not in/etc/passwd
).the way to achieve that is:
See the
group
resource documentation for more details and available attributes.Change action to
:create
if the group does not already exists.