Ask Your Question
0

assign existing group as primary to pe_accounts::user type

asked 2015-03-24 09:05:54 -0500

EricL gravatar image

updated 2015-03-24 14:44:39 -0500

Hi, wondering how to do this. According to the documentation, the 'gid' parameter will assign the primary group using the same name as the user. The 'groups' parameter is an array of supplemental groups and should not include the primary group. I have a scenario where I have a group called 'users', gid=100 already existing. I'd like to create users using the pe_accounts::user type and have 'users' be the primary group for all of them.

Update - I found a solution to a similar problem, but not this one exactly. In the case where I am adding a group that I want multiple users to be a member of, instead of adding the group first then the user, I add the user of the same name first in the users class. The creation of the user will also create the group, then subsequent definitions of the user type can be given my new group as a supplemental group. However this doesn't fix the problem with the 'users' group which is part of the default OS install (working with RHEL 6). I tried creating a class to specifically remove the users group first, but that failed because a default user has 'users' as its primary group. Thanks

edit retag flag offensive close merge delete

Comments

Could you rephrase your question? Perhaps provide an example of what the 'groups $user' command shows currently and what you would like it to show upon successful application of a catalog.

rnelson0 gravatar imagernelson0 ( 2015-03-25 20:19:42 -0500 )edit

The user I want to maniuplate doesn't exist yet. When I create it, I want its primary group to be 'users' which is an existing group. So if EricL's UID is 500, and the existing 'users' group gid is 100 I want this in /etc/passwd: EricL:x:500:100: ...

EricL gravatar imageEricL ( 2015-03-26 13:17:53 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-04-02 14:07:17 -0500

GregLarkin gravatar image

Unfortunately, you cannot use the pe_accounts::user type with an existing group, according to this bug report: https://tickets.puppetlabs.com/browse...

The only near-solution I see is to assign users to the groups parameter when you apply the type to your node.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-03-24 09:05:54 -0500

Seen: 268 times

Last updated: Apr 02 '15