[PROPOSAL] Using YUM/RPM repositories via 'mirrorlist'

Niels Basjes cobbler at basjes.nl
Tue May 11 13:37:08 UTC 2010


Hi,

If I look at the repo files created by cobbler I see the following effect.

Assume I initially add a repository as being hosted externally (not
mirrored locally). And after a while I choose to mirror the repository
locally because of ... lets say performance reasons or something like
that.

In the current situation this means that all clients need to be
updated because the configure URL have been distributed over all
nodes.
I think we could do better than that.

During installation the yum_repo_stanza will look like this:
    repo --name=CentOS5-x86_64-EPEL
--baseurl=http://mirrors.kernel.org/fedora-epel/5/x86_64/
Which is fine because it is used only once (only at the time of installation)

The problem I have is that the config file generated for yum (i.e.
/etc/yum.repos.d/cobbler-config.repo ) has several blocks like this:

[CentOS5-x86_64-EPEL]
name=CentOS5-x86_64-EPEL
baseurl=http://mirrors.kernel.org/fedora-epel/5/x86_64/
enabled=1
priority=50
gpgcheck=0

Now if I choose to change the location of the actual repository then I
need some way of updating all clients.
( One possible way of doing this is by creating a daily cron script
that simply pulls the new version of the cobbler-config.repo .... YUCK
)

Now my proposal is a simpler and cleaner solution to this issue that
only takes a few minor changes in cobbler and simply starts using a
feature that is there for this purpose:

1) A new file is created for each repository that simply contains the
URL to the currently configured 'real' repository location:
I.e. a file like this
/var/www/cobbler/repo_mirror/CentOS5-x86_64-EPEL/mirror.list
which simply contains the URL of the configured mirror. In this example:
     http://mirrors.kernel.org/fedora-epel/5/x86_64/
If we DO mirror this repository then this file will contain something like this:
     http://192.168.1.1/cobbler/repo_mirror/CentOS5-x86_64-EPEL/

2) The cobbler-config.repo is now generated slightly different:
Instead of a baseurl we place a mirrorlist option in there with a
value that won't change.

[CentOS5-x86_64-EPEL]
name=CentOS5-x86_64-EPEL
mirrorlist=http://192.168.1.1/cobbler/repo_mirror/CentOS5-x86_64-EPEL/mirror.list
enabled=1
priority=50
gpgcheck=0



The overall effect is that there is no need to update the clients anymore.

What do you think of this proposal?

-- 
Met vriendelijke groeten,

Niels Basjes


More information about the cobbler-devel mailing list