Jeff Adams
2008-Jul-29 19:27 UTC
[Puppet Users] How can you specify a default package provider per OS?
Greetings, I now have the good fortune to add CentOS as second OS into the mix of servers we''re managing. Our primary OS is Debian, and I''ve defined aptitude as the provider of packages within my classes. This, unfortunately but not surprisingly, is not making the CentOS servers very happy. Before I go and re-write my classes to either remove the provider or to replace it with a case statement, I was hoping to be able to specify within my $operatingsystem classes (or where ever it works) a default provider for each particular OS. My searching didn''t turn anything up, so I''m hoping someone can share how they''ve solved this problem. Thanks, - Jeff --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
jtimberman
2008-Jul-29 20:43 UTC
[Puppet Users] Re: How can you specify a default package provider per OS?
On Jul 29, 1:27 pm, Jeff Adams <jeff.ad...@kw.com> wrote:> > I now have the good fortune to add CentOS as second OS into the mix of > servers we''re managing. Our primary OS is Debian, and I''ve defined > aptitude as the provider of packages within my classes. This, > unfortunately but not surprisingly, is not making the CentOS servers > very happy.What is wrong with letting Puppet pick the provider by default?> Before I go and re-write my classes to either remove the provider or to > replace it with a case statement, I was hoping to be able to specify > within my $operatingsystem classes (or where ever it works) a defaultYou can set a per-resource type default at the "site" level in site.pp before any imports/includes, or at a per-class namespace level. I haven''t done this with a selector for OS''s, but this should work: Package { provider => $operatingsystem ? { centos => "yum", debian => "apt", default => undef } } --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Marcin Owsiany
2008-Jul-30 02:27 UTC
[Puppet Users] Re: How can you specify a default package provider per OS?
On Tue, Jul 29, 2008 at 02:27:09PM -0500, Jeff Adams wrote:> I''ve defined > aptitude as the provider of packages within my classes.Just a friendly FYI: aptitude may not be the best provider to use: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=445035 -- Marcin Owsiany <marcin@owsiany.pl> http://marcin.owsiany.pl/ GnuPG: 1024D/60F41216 FE67 DA2D 0ACA FC5E 3F75 D6F6 3A0D 8AA0 60F4 1216 "Every program in development at MIT expands until it can read mail." -- Unknown --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---