On Dec 14, 1:09 am, Marek Dohojda <[email protected]> wrote:
> I am wondering what would be a good way of managing users. I need to add
> user to some host and ensure that they are absent on another box. so for
> instance, I want Bob to be present on server A but absent on server B. as
> far as I know, you can only have one defined object. so I could have Bob
> either set to ensure present or ensure absent.
No node may declare duplicate resources, but that does not mean your
overall manifest set cannot do so.
> Is there a way to have users be in two different classes?
Absolutely:
class users::serverA {
user { 'bob': ensure => 'present' }
}
class users::serverB {
user { 'bob': ensure => 'absent' }
}
Nodes may include at most one of those two classes, but there is no
problem with both being available.
There are several other ways to approach the problem as well.
Depending on the circumstances, I might look to a data-driven approach
based involving the create_resources() function, for instance.
John
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.