Daniel Maher
2010-Nov-18 08:56 UTC
[Puppet Users] best way to ensure (yum) package repository freshness ?
Hello, I have run into problems in the past where a package has been added to our yum repository, and a (new) class has been pushed to install that package, but puppet fails because the yum db on the target machine is too stale, and thus isn''t aware of the existence of the new package. My question is this : what have other Puppet admins done in order to ensure that a target machine has the freshest local dbcache before attempting to install a package ? Thank you. -- Daniel Maher <dma AT witbe DOT net> "The Internet is completely over." -- Prince -- 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.
Ian Ward Comfort
2010-Nov-18 09:52 UTC
Re: [Puppet Users] best way to ensure (yum) package repository freshness ?
On 18 Nov 2010, at 12:56 AM, Daniel Maher wrote:> I have run into problems in the past where a package has been added to our yum repository, and a (new) class has been pushed to install that package, but puppet fails because the yum db on the target machine is too stale, and thus isn''t aware of the existence of the new package. > > My question is this : what have other Puppet admins done in order to ensure that a target machine has the freshest local dbcache before attempting to install a package ?We haven''t run into this problem here, but I imagine something like the following (untested) code might help: exec { ''yum-clean-expire-cache'': user => ''root'', path => ''/usr/bin'', command => ''yum clean expire-cache'', } Package { require => Exec[''yum-clean-expire-cache''] } package { [''foo'',''bar'']: ensure => present } That should make Puppet revalidate all of yum''s caches before attempting to install either the foo or bar packages (or any packages for which the above resource default is in scope). ''yum clean expire-cache'' is the cheapest way to ensure an updated view of your yum repos, without deleting too much metadata which may need re-downloading in case the repos are unchanged. Note that this clean would happen on every Puppet run, of course, and that may not be desirable. -- Ian Ward Comfort <icomfort@stanford.edu> Systems Team Lead, Academic Computing Services, Stanford University -- 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.
Trevor Hemsley
2010-Nov-18 10:01 UTC
Re: [Puppet Users] best way to ensure (yum) package repository freshness ?
Perhaps you could adjust one of the /etc/yum.conf parameters like metadata_expire down from its default of 1.5 hours or keepcache = false (not entirely sure that this one does what you want it to do). The metadata_expire one can be set at the repo level so you could set it only for your own repo. On 18/11/2010 08:56, Daniel Maher wrote:> Hello, > > I have run into problems in the past where a package has been added to > our yum repository, and a (new) class has been pushed to install that > package, but puppet fails because the yum db on the target machine is > too stale, and thus isn''t aware of the existence of the new package. > > My question is this : what have other Puppet admins done in order to > ensure that a target machine has the freshest local dbcache before > attempting to install a package ? > > Thank you. >-- Trevor Hemsley Infrastructure Engineer ................................................. *C A L Y P S O * Brighton, UK OFFICE +44 (0) 1273 666 350 FAX +44 (0) 1273 666 351 ................................................. www.calypso.com This electronic-mail might contain confidential information intended only for the use by the entity named. If the reader of this message is not the intended recipient, the reader is hereby notified that any dissemination, distribution or copying is strictly prohibited. *P * /*/Please consider the environment before printing this e-mail /*/ -- 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.
Patrick
2010-Nov-18 10:41 UTC
Re: [Puppet Users] best way to ensure (yum) package repository freshness ?
On Nov 18, 2010, at 12:56 AM, Daniel Maher wrote:> Hello, > > I have run into problems in the past where a package has been added to our yum repository, and a (new) class has been pushed to install that package, but puppet fails because the yum db on the target machine is too stale, and thus isn''t aware of the existence of the new package. > > My question is this : what have other Puppet admins done in order to ensure that a target machine has the freshest local dbcache before attempting to install a package ? > > Thank you.What ever you do, you will probably want to make sure you have a caching proxy server (or an on site mirror) between your clients and the yum server. -- 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.
jcbollinger
2010-Nov-18 14:08 UTC
[Puppet Users] Re: best way to ensure (yum) package repository freshness ?
On Nov 18, 2:56 am, Daniel Maher <d...@witbe.net> wrote:> My question is this : what have other Puppet admins done in order to > ensure that a target machine has the freshest local dbcache before > attempting to install a package ?I set up a cron job (via Puppet) that periodically performs a "yum clean all". That''s a bit crude, and it allows for a delay before a new package is recognized and installed, but it works well enough for me. 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.