-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Group with the same name as user is Always created. #77
Comments
@ruriky Have you installed |
Have the same issude here is my hiera:
result:
My PUppetfile
|
I'm having the same issue here too, on 1.5.2... It seems as though primary_group is ignored - though it does seems to manage .ssh directory permissions correctly, effectively doing a chgrp $primary_group. I have deric-gpasswd (0.3.2) installed. |
My setup under CentOS 6.9:
I also seem to be seeing the |
Same issue here with 7.x. This module is pretty much useless to me if I can't keep it from creating all these unwanted groups. deric-gpasswd is loaded. |
@ruriky Sorry for late reply. From Puppet's documentation:
It doesn't make much sense to set
The problem is in the first command. E.g. on Debian |
I know it doesn't make sense, and that it's bad practice these days, but many years ago it wasn't common practice to set up a group for just one user. Unfortunately where I work at still has this legacy practice and all users are assigned into a common user group (users, consultants, security, etc.) as their primary group to share specific resources. With CentOS 6 and OEL 6 at my location I can get the module to do this as I expect. But with CentOS & OEL 7 I can't. It insists on setting the primary group to the UID group even when specified otherwise. And thanks, better late than never! |
Yeah, I understand your motivation. It sounds rather easy, but it's actually quite hard to implement. |
Well I'm kind of confused why this works with 6 but not 7, but I don't understand the coding of the module, still too green with Puppet. I was able to get this working with Puppet's user module though it's lacking some of the features of yours. You might want to make note somewhere of this behavior so someone else doesn't spend the hours I did trying to figure out what was going wrong. |
I've managed to write a hacky way how to bypass commands executed by Puppet's providers. I'm not sure if this is the best way how to tackle this issue. But so far it's the only working solution. Following configuration works (with branch 1.6): accounts::groups:
mygroup:
gid: 1141
accounts::users:
testuser:
ensure: 'present'
home: "/home/testuser"
shell: "/bin/bash"
uid: 1141
primary_group: 'mygroup'
manage_group: true
This is not true anymore, The user & groups management in Puppet is not ideal, there's a huge epic for refactoring targeting Puppet 5. Hopefully this module won't be needed in future versions. Btw. automated tests might be incomplete, but seems to pass on CentOS 7. |
If I set
manage_group = false
, a group with the same name as the user is always created. I haven't been able to prevent that with any set of configuration.For example, in my test case, where I want to create a new group with name
mygroup
which has the same gid as the user's uid. It fails with the error below:Greping
/etc/group
shows that there is a new group with same as the user and gid is set to users uid (this is the default behavior of puppets 'user' function when no gid is provided - am I correct ?)I get the same error if I move the creation of
mygroup
underaccounts::groups
.Puppet version is 3.8.6 and OS is RHEL7.
The text was updated successfully, but these errors were encountered: