Management of yumrepo
Created by: djjudas21
I think there's a bug in this module. I'm running puppet 3.8.4 on CentOS 7, not from Puppet Collections. Your module installs puppetlabs-release
in repo.pp
and then goes on to manage several yumrepo
resources in repo/yum.pp
. The end result is that on my system, in /etc/yum.repos.d
I have one file puppetlabs.repo
which contains all 6 repo definitions and also a set of 6 files named puppetlabs-products.repo
, puppetlabs-deps
, etc.
Unless I've missed something, I can't see the benefit of managing these pieces of config twice. It causes the following problems:
[jg4461@dhcp-p3 ~]$ yum repolist
Loaded plugins: fastestmirror, langpacks
Repository puppetlabs-products is listed more than once in the configuration
...
[jg4461@dhcp-p3 ~]$ sudo puppet agent -t
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for dhcp-p3.isys.bris.ac.uk
Info: Applying configuration version '1453369477'
Error: Could not prefetch yumrepo provider 'inifile': Section "puppetlabs-products" is already defined, cannot redefine in /etc/yum.repos.d/puppetlabs-products.repo
...
The way I see it, there are 4 ways of fixing this:
- Stop installing the
puppetlabs-release
package - Stop handling the
yumrepo
resources - Add
require => Package['puppetlabs-release']
to everyyumrepo
in the vain hope that it might installpuppetlabs-release
first and then useyumrepo
to manage the contents of it without duplicating them. - Allow users to enable/disable management of the
puppetlabs-release
package andyumrepo
resources by setting a parameter
I'm happy to fix the bug and send a PR but I want to know your preferred method before I start.
Cheers, Jonathan