On Thursday, July 2, 2015 at 10:52:26 AM UTC-5, Vince Skahan wrote: > > > We've set up local mirrors of a number of upstream repos, and want to > point our puppet-managed boxes at the local mirrors only. > > Assuming we named our mirror repos local-mirror-whatever, if I was using > yum on the commandline, I could do it on the fly by disabling all repos and > then enabling the repo(s) that I wanted visible for that yum transaction > ala: > yum --disablerepo=* --enablerepo=local-mirror* install foo > > Is there a clean way to do this in puppet ? > > Alternately, I guess I could just remove all the files (other than ours) > in /etc/yum.repos.d but that seems a little kludgey to me and I'd need to > make sure that subsequent yum updates didn't put them back on me. > > Any ideas ? > > >
Puppet provides a Yumrepo resource type for managing Yum repository definitions. It has an 'enabled' property, which you can set false to disable repos you want to keep but not use. This has the advantage that you no longer need to disable these repos from the command line, either, but the disadvantage that it affects only the repos you in fact manage. If you are concerned that unmanaged repos may be be added to your systems, and you are running at least Puppet 3.5, then you should be able to use the Resources metaresource to purge unmanaged repos. John -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/be8fa8df-cf1d-403f-b0cc-a4df71f50f34%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.