So after a long conversation with Dan White I got him to a comfortable interim solution.
That being said, I don't understand how this is supposed to work.
So the use case:
Local cobbler system mirroring RHN channels to provide a local mirror augmenting RHN. All the systems still attach to RHN. Yum complains about duplicate named repositories.
Dan said he had it working on version 0.5.4-22.el5, but going up to 0.5.4-22.el5_7.1 it breaks.
However on my 0.5.4-17.el5_6.1 is broken as well.
[root@myboxen yum.repos.d]# rpm -q yum-rhn-plugin yum-rhn-plugin-0.5.4-17.el5_6.1
[root@myboxen yum.repos.d]# yum repolist Loaded plugins: rhnplugin, security
Repository rhel-x86_64-server-5 is listed more than once in the configuration
When you mirror a RHN channel into cobbler as a repository it requires that the name of the repository match the name of the channel from RHN. But if you tell the system to attach the cobbler repos to yum for use post-installation that same repository gets created in the cobbler-config.repo file.
The interim fix I gave him was to rename that single repository with a sed script in his %post after the repo file is downloaded.
In /usr/lib/python*/site-packages/cobbler/action_reposync.py in the create_local_file method we tried replacing:
config_file.write("[%s]\n" % repo.name)
with
if output and repo.breed == 'rhn': config_file.write("[cobbler-%s]\n" % repo.name) else: config_file.write("[%s]\n" % repo.name)
But since that is not how the cobbler-config.repo file is generated the logic never got accessed.
any thoughts?