Repository use a Mirrorlist instead of one single url

Hello,

When I build a repository: is there a way to use a mirrorlist as one would find in the default CentOS-Base.repo?

for instance: I would like my foreman/katello server to be able to pull packages down from a range of repositories rather than having to select just one.

At the moment I am upgrading to foreman 3.5, but I am asking as this is the time to experiment.

–jason

This is not possible.

I assume you mean during provisioning with kickstart, so here:

The repo command is documented here:

https://pykickstart.readthedocs.io/en/latest/kickstart-docs.html#repo

As you can see, the command does accept both --mirrorlist and --metalink as parameters, but the template has no way of providing them.

It iterates over the various medium providers, which implement the interface. Right now there’s no good way of providing that additional data, so that would be a feature request.

In the short term you can close the template and hardcode it. Not pretty, but it works.

I think they are talking about the URL for content repos in Katello.

As far as I know you can’t use a mirror list there and have to give it an actual URL to an upstream repo.

I cannot say how or when this became supported but empirically now in 2024 running Foreman version 3.10.0 I am able to supply a mirror list URL in the ‘Sync Settings’ > ‘Upstream URL’ field of the Foreman repository settings page and it does work to automatically select the mirror with the best network connectivity and sync. Understandably the variable substitutions like ‘$releasever’ often used in a yum .repo file do not work.

As an example I’m using the following URLs in my Foreman repo config:

https://mirrors.rockylinux.org/mirrorlist?arch=x86_64&repo=AppStream-9
https://mirrors.rockylinux.org/mirrorlist?arch=x86_64&repo=AppStream-9-debug
https://mirrors.rockylinux.org/mirrorlist?arch=x86_64&repo=BaseOS-9
https://mirrors.rockylinux.org/mirrorlist?arch=x86_64&repo=BaseOS-9-debug
https://mirrors.rockylinux.org/mirrorlist?arch=x86_64&repo=CRB-9