sous-chefs / users

Development repository for the users cookbook
https://supermarket.chef.io/cookbooks/users
Apache License 2.0
138 stars 217 forks source link

Group creation on user creation #85

Closed pielu closed 3 years ago

pielu commented 9 years ago

I think the assumption to obligatory create group with same name as user name is bit too rigid. Instead I would suggest to get first group in the array of groups and check if it exists. If yes, then fetch its gid. If not, create the group (with gid if defined in the resource). Then use that gid when creating the user later on in the provider. Additional drawback of group name after user name is that this group becomes user's main group. That's undesirable and is just a side effect of that chicken - egg problem.

aaron-lane commented 9 years ago

:+1:

djdefi commented 9 years ago

+1

Would love to just place my users into an existing default group such as "users" rather than a group for each user.

majormoses commented 8 years ago

This is a breaking change and one that I see as being just as opinionated as adding a user to their own group with no significant gain. We should allow you to change the existing behavior to allow you to specify the groups but maybe do that as a separate key in the data bag such as "primary_group" and default to the user specified.

sonnysideup commented 8 years ago

@pielu had a PR that was closed and not merged because he didn't adhere to the Chef CLA. Is there any other movement here?

msgarbossa commented 6 years ago

I submitted PR#417 to try and fix this. User Private Groups (UPG) are very common on Linux platforms, but not on AIX. I think it's good to have the flexibility to turn UPG off when it is not desired. The default remains UPG = true to retain the current behavior.

majormoses commented 6 years ago

@msgarbossa sounds like a reasonable solution, seems like we should close #350 in favor of #417 unless I am missing something.

msgarbossa commented 6 years ago

@majormoses we should close #350 in favor of #417. #350 is old and was before the change from the provider to the custom resource. The property name is debatable. Originally it was use_usergroup, but User Private Group (UPG) seems to be the industry accepted term in Redhat and Ubuntu documentation. Therefore, this PR has "upg" for the property name to keep it short.

frank-m commented 3 years ago

This has been resolved in 6.0.0. You can set no_user_group to true per user to no longer create users groups.