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. Is there a way to have users be in two different classes? Thank you -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On 14 Dec 2011, at 07:10, Marek Dohojda <chrobry@gmail.com> 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. > Is there a way to have users be in two different classes? > > Thank youVirtual resources are what you''re after: http://docs.puppetlabs.com/guides/virtual_resources.html Cheers, -- Richard Clark richard@fohnet.co.uk -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On Dec 14, 1:09 am, Marek Dohojda <chro...@gmail.com> 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 puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.