I just have it run a "yum clean all" exec command every time a repo is updated. Since they all refer to the same exec, it only happens once after the repos are updated.
The tricky part is ensuring that anything trying to update software in the same run has a require=> set that ensures all the yum repos and the yum clean all are completed before they run, or you get: update yum repo update package yum clean all …. I just require the entire yumrepo class, but there may be better ways. On May 4, 2012, at 6:54 AM, Andy Taylor wrote: > I'm trying to get my yum module to manage system repositories like > CentOS-Base. My yum module is part of a pre run stage so it puts the > necessary repositories in place before other modules try to install > anything. > > I've just run into a problem though; when Puppet installs a repo via > yumrepo, it doesn't clear the yum cache. This means that when the > modules in the main stage start trying to install packages, many will > error as yum doesn't see the new respositories. > > Running yum clean metadata fixes this, but I'm not sure how best to > automate it in the module. I don't want to turn metadata caching off, > or have a regular cron flushing it as I've seeen suggested before - an > exec subscribed to /etc/yum.repos.d would be perfect, but that doesn't > work. > > I'm posting this here prior to putting something in the Puppet Labs > bug tracker, as either a feature request or a bug (I think it's fairly > essential that adding repositories leads to a refresh of yum cache... > shouldn't really have to work around it in my opinion) > > Thanks! > > Andy > > -- > 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+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > -- Jo Rhett Net Consonance : net philanthropy to improve open source and internet projects. -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.