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
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 <icom...@stanford.edu>
Systems Team Lead, Academic Computing Services, Stanford University
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
> 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.
I came a across this post and like what I see but would off the following addition to Ian's suggestion so that the expire cache is not executed on every puppet run.exec { 'yum-clean-expire-cache':command => '/usr/bin/yum clean expire-cache',refreshonly => true,}package { ['foobar']:ensure => present,require => Exec['yum-clean-expire-cache',}