The ‘users’ cookbook basically requires a separate cookbook and recipes to manage your own group or list of groups. It would be potentially quite helpful to have that information selectable on a role or environment basis, rather than requiring in-house recipes.
Lead DevOps Engineer
From: George Miranda [mailto:email@example.com]
Sent: Tuesday, February 24, 2015 11:53 PM
Subject: [chef] Re: How to add all the groups to a newly created user?
The users_manage resource from the community “users” cookbook takes the name of a group you want to configure and only ensures that group (and any of its users) are on the system. If you want to ensure “vagrant”, “wheel”, etc are on your system you must use a users_manage resource for all of the groups you want configured on the system. Then you will see that your “project” user is associated with the groups you expect.
A detailed look at how that works can be found on the Chef blog
On Tue, Feb 24, 2015 at 8:41 PM, Anthony Kong <firstname.lastname@example.org:email@example.com> wrote:
it is my user json file in the data bag
"groups": ["vagrant", "wheel", "admin", "sensu", "chef", "adm", "cdrom", "sudo", "dip", "plugdev", "lpadamin"]
In my default.rb cookbook, I have these lines
users_manage “admin” do
After the user is created, it looks like this:
uid=1000(project) gid=1000(project) groups=1000(project),2302(admin)
How can I get the user to be member of all the groups mentioned in the json file?