Hi, It''s easy enough to modify, say, the "exclude" variable in /etc/yum.conf with something like: augeas { yum_exclude_kernel: context => ''/files/etc/yum.conf/main'', changes => ''set exclude kernel*'' } However, I''d like a more flexible system where I can "build" the list of excludes from various classes. Has anyone come up with a good solution to this type of problem? Thanks in advance. Gonzalo -- 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.
Hey Gonzalo, Have you tried Hiera at all? (http://github.com/puppetlabs/hiera and http://github.com/puppetlabs/hiera-puppet ) With Hiera (and, specifically the hiera_array() function), you can scour through a hierarchy to populate a variable inside your Puppet manifest. If you had a variable to set excludes in many levels of your hierarchy, then hiera_array(''yum_excludes'') would search every level of the hierarchy (pertinent to your node according to its Facter facts) for a variable called ''yum_excludes'', and return an array with all values that it finds. You could then utilize a template to populate the "exclude=" line in yum.conf. On Thu, Feb 16, 2012 at 10:09 PM, Gonzalo Servat <gservat@gmail.com> wrote:> Hi, > > It''s easy enough to modify, say, the "exclude" variable in /etc/yum.conf > with something like: > > augeas { yum_exclude_kernel: > context => ''/files/etc/yum.conf/main'', > changes => ''set exclude kernel*'' > } > > However, I''d like a more flexible system where I can "build" the list of > excludes from various classes. Has anyone come up with a good solution to > this type of problem? > > Thanks in advance. > > Gonzalo > > -- > 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. >-- Gary Larizza Professional Services Engineer Puppet Labs -- 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 Fri, Feb 17, 2012 at 5:26 PM, Gary Larizza <gary@puppetlabs.com> wrote:> Hey Gonzalo, > > Have you tried Hiera at all? (http://github.com/puppetlabs/hiera and > http://github.com/puppetlabs/hiera-puppet ) With Hiera (and, > specifically the hiera_array() function), you can scour through a hierarchy > to populate a variable inside your Puppet manifest. If you had a variable > to set excludes in many levels of your hierarchy, then > hiera_array(''yum_excludes'') would search every level of the hierarchy > (pertinent to your node according to its Facter facts) for a variable > called ''yum_excludes'', and return an array with all values that it finds. > You could then utilize a template to populate the "exclude=" line in > yum.conf. >Ah, yes. I''ve heard of Hiera but didn''t really have a use case for it. I''ll definitely check it out. Thanks Gary! - Gonzalo -- 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 Fri, Feb 17, 2012 at 5:26 PM, Gary Larizza <gary@puppetlabs.com> wrote:> Hey Gonzalo, > > Have you tried Hiera at all? (http://github.com/puppetlabs/hiera and > http://github.com/puppetlabs/hiera-puppet ) With Hiera (and, > specifically the hiera_array() function), you can scour through a hierarchy > to populate a variable inside your Puppet manifest. If you had a variable > to set excludes in many levels of your hierarchy, then > hiera_array(''yum_excludes'') would search every level of the hierarchy > (pertinent to your node according to its Facter facts) for a variable > called ''yum_excludes'', and return an array with all values that it finds. > You could then utilize a template to populate the "exclude=" line in > yum.conf. >Hiera looks good, however in my case where I may want to build an array of yum_excludes from various classes, I''m not sure it suits this problem case. I can see Hiera being useful in cases where you might have different distributions, networks, etc. but building up an array from any number of classes, how would it work? Were you thinking that I could add the class name to the hiera hierarchy and set yum_excludes in there? - Gonzalo -- 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.