Bret Wortman
2012-Nov-27 12:32 UTC
[Puppet Users] Right way to implement "roles" in hiera/puppet
I''m looking to implement a hiera backend for our Puppet installation, as we routinely deploy systems that are of varying hardware, OS, and which may have multiple roles they fill. I''ve figured out, I think, how to handle the OS question through facter, but implementing server roles isn''t quite so clear. I want to maintain that information on the server, not on the clients, but everything hiera-related seems to use the facts for a given system. Installing a file containing the roles on the client seems like a kludge. Is there a more hiera-ish, puppet-ish way to accomplish this? Thanks! -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/4lq873kkuQ0J. 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.
jcbollinger
2012-Nov-28 14:57 UTC
[Puppet Users] Re: Right way to implement "roles" in hiera/puppet
On Tuesday, November 27, 2012 6:32:23 AM UTC-6, Bret Wortman wrote:> > I''m looking to implement a hiera backend for our Puppet installation, as > we routinely deploy systems that are of varying hardware, OS, and which may > have multiple roles they fill. > > I''ve figured out, I think, how to handle the OS question through facter, > but implementing server roles isn''t quite so clear. I want to maintain that > information on the server, not on the clients, but everything hiera-related > seems to use the facts for a given system. Installing a file containing the > roles on the client seems like a kludge. Is there a more hiera-ish, > puppet-ish way to accomplish this? > >Suppose you define one class for each role (each of which may declare any number of resources and other classes). In Puppet 3, I think you can do this: # An array of the names of the needed role classes $role_classes = hiera(''role_classes'') # Declare those classes include ${role_classes} If I recall correctly, though, you can accomplish the same thing, even in Puppet 2.[67], with hiera_include(''role_classes'') John -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/NeueswuE5i8J. 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.