On 12/29/2010 01:26 PM, Adam Nielsen wrote:
> Hi all,
> 
> I have a site.pp which defines the user I want to log in as, however on
> some nodes (depending on which software is installed) this user needs to
> be a member of particular groups.
> 
> If I define the user in site.pp with core details and then in each class
> alter the group membership (the idea being including all the necessary
> classes will install the software, configure it, and make me a member of
> all the necessary groups) I get this error:
> 
> Error 400 on SERVER: Duplicate definition: User[adam] is already defined
> in file ...; cannot redefine at ...
> 
> Is there any way I can make the node definition "inherit" the site one? 
> All I want to do is add another entry into the array passed as the
> 'groups' parameter.

Good keyword that.

Put the use definition in a class. Each list of groups is a subclass
such that

class my_user_in_group_foo inherits my_user {
  User["bla"] { groups +> [ "foo", "bar" ] }
}

Include those subclasses as appropriate.

HTH,
Felix

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to