Fernando Padilla
2009-Jul-14 16:40 UTC
[Puppet Users] how to add apt repository with puppet
I keep googling, but I can''t seem to find the answer. What''s the best way to add a apt-repository (ubuntu or rpm), using puppet, and still have all of the package resource dependencies met.. 1) add repository (file to /etc/apt/sources.list.d/NEWREPFILE) 2) run apt-get update (if any files change under /etc/apt/.....) 3) make sure this is run before any other package[] resources are attempted to be resolved. I know I can set this up.. and do an explicit dependency between the package resource I know lives in the new repository, but I wonder how would I do it so that the new repository is added (and apt-get update is run) before any package resource.. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Nigel Kersten
2009-Jul-14 22:14 UTC
[Puppet Users] Re: how to add apt repository with puppet
On Tue, Jul 14, 2009 at 9:40 AM, Fernando Padilla<fern@alum.mit.edu> wrote:> > I keep googling, but I can''t seem to find the answer. > > What''s the best way to add a apt-repository (ubuntu or rpm), using > puppet, and still have all of the package resource dependencies met.. > > 1) add repository (file to /etc/apt/sources.list.d/NEWREPFILE) > 2) run apt-get update (if any files change under /etc/apt/.....) > 3) make sure this is run before any other package[] resources are > attempted to be resolved. > > I know I can set this up.. and do an explicit dependency between the > package resource I know lives in the new repository, but I wonder how > would I do it so that the new repository is added (and apt-get update is > run) before any package resource..Package { require => [ File["sources_list"], Exec["apt_update"], } assuming you have a File["sources_list"] set up to manage your sources, and an Exec["apt_update"] to run apt-get update for you. This will run every time, but if you want the Exec to be a bit smarter, you''ll need to do some logic there. I''m quite happy with running apt-get update on each puppet run as we don''t run every 30 minutes.> > > >-- Nigel Kersten nigelk@google.com System Administrator Google, Inc. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Mark Foster
2009-Jul-24 05:32 UTC
[Puppet Users] Re: how to add apt repository with puppet
In case it saves you any time... the file in /etc/apt/sources.list.d/ needs to end in .list or it will be ignored. -Signed, someone who learned the hard way. On Jul 14, 9:40 am, Fernando Padilla <f...@alum.mit.edu> wrote:> I keep googling, but I can''t seem to find the answer. > > What''s the best way to add a apt-repository (ubuntu or rpm), using > puppet, and still have all of the package resource dependencies met.. > > 1) add repository (file to /etc/apt/sources.list.d/NEWREPFILE) > 2) run apt-get update (if any files change under /etc/apt/.....) > 3) make sure this is run before any other package[] resources are > attempted to be resolved. > > I know I can set this up.. and do an explicit dependency between the > package resource I know lives in the new repository, but I wonder how > would I do it so that the new repository is added (and apt-get update is > run) before any package resource..--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---