Ask Your Question

Is it possible to modify group memberships for virtual users on different servers?

asked 2013-10-03 14:34:41 -0500

AXE-Labs gravatar image

I define my users as virtual resources and then realize them on different servers based on the teg like so:

@user::myusers {
    groups => [ "wheel", "audio" ],
    tag => "level1";
    groups => [ "wheel", "puppet" ],
    tag => "level2";
     groups =>[ $hostname ? { integrate => "operators", default => ''}, ],
     tag => "level1";

For some servers I would like to realize the users with a slightly different group membership so the group entry for user3 works but if I try to combine that with another, static group like below, it fails:

groups =>[ $hostname ? { integrate => "operators", default => ''}, "puppet" ],

It case of the default match the list is created as [ '', "puppet' ] and the ... (more)

edit retag flag offensive close merge delete


What version and edition of Puppet are you using? Can you post the error message emitted by the agent?

GregLarkin gravatar imageGregLarkin ( 2013-10-03 15:56:17 -0500 )edit

I'm doing this on puppet puppet-3.3.0-1. I get: Wrapped exception: Group names must not be empty. If you want to specify "no groups" pass an empty array ...(more)

AXE-Labs gravatar imageAXE-Labs ( 2013-10-03 20:19:00 -0500 )edit

Could you create a dummy group and replace the default with the name of that group? It wouldn't serve any real purpose except to avoid this error, but it ...(more)

GregLarkin gravatar imageGregLarkin ( 2013-10-03 21:11:18 -0500 )edit

I like the idea of the default always having a value... Is there a way to reference the username on the groups line?

AXE-Labs gravatar imageAXE-Labs ( 2013-10-04 09:49:30 -0500 )edit

Thank you for the reply and the useful link!

AXE-Labs gravatar imageAXE-Labs ( 2013-10-04 11:27:58 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2013-10-04 10:32:57 -0500

GregLarkin gravatar image

I don't see a way to do that ATM, but I wonder if using overrides when realizing the virtual user resources would help. Perhaps this will be useful: http ... (more)

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


Asked: 2013-10-03 14:34:41 -0500

Seen: 184 times

Last updated: Oct 03 '13