Closed pielu closed 3 years ago
:+1:
+1
Would love to just place my users into an existing default group such as "users" rather than a group for each user.
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.
@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?
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.
@msgarbossa sounds like a reasonable solution, seems like we should close #350 in favor of #417 unless I am missing something.
@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.
This has been resolved in 6.0.0. You can set no_user_group to true per user to no longer create users groups.
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.