Skip to content
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

Option to manage the primary group of an user. #12

Closed
Dimitar-Boychev opened this issue Apr 6, 2015 · 4 comments
Closed

Option to manage the primary group of an user. #12

Dimitar-Boychev opened this issue Apr 6, 2015 · 4 comments

Comments

@Dimitar-Boychev
Copy link

It will be really nice to have an option to change the primary group of the user.
Now if you try to set a gid to an existing gid the groupmod fails with:

Could not set gid on group[john]: Execution of '/usr/sbin/groupmod -g 1696 john' returned 4: groupmod: GID '1696' already exists

Update: the normal puppet "user" resource allows you to specify an existing group as primary group.

user { "neo":
  ensure     => "present",
  managehome => true,
  gid => 1000 #this is an already existing group
}
@deric
Copy link
Owner

deric commented Apr 8, 2015

You could use the groups parameter, right?

user { "neo":
  ensure            => "present",
  managehome => true,
  groups            => ['users']
}

@deric deric closed this as completed in a72639e Apr 8, 2015
@deric
Copy link
Owner

deric commented Apr 8, 2015

I've added a parameter manage_group

user { "neo":
  manage_group => false,
}

which will disable creating a group. Hopefully it will solve your issue.

The naming is not consistent with managehome, but I'd like to change that one to manage_home is some future release.

@Dimitar-Boychev
Copy link
Author

Hello,
the problem in using groups => ['users'] on neo for example is that this produces
user neo with primary group neo and a secondary group users.
And with the original user resource it produces user neo with primary group users.

@deric
Copy link
Owner

deric commented Apr 8, 2015

Right, according to documentation as gid we can supply a name, thus you could create a primary group with:

user { "neo":
  gid => 'primary-group',
}

if we fix the numerical validation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants