Modify modulemd_defaults

Problem:
We want to change the default stream for certain modules in the RHEL8 AppStream repo. The reason for this is that Red Hat in several cases sets an unsupported (EOL) stream as the default, which may also contain known security vulnerabilities (for example the nginx module where 1.14 is the default stream which is no longer supported or patched).

Can we do this with Pulp and if so - how?

I’ve looked at the ‘modulemd_defaults’ endpoint in pulp rpm plugin but can’t find any way of modifying existing modulemd_defaults files.
I also know we can do this on each dnf client in /etc/dnf/modules.defaults.d/ but I was hoping we could do this at the source instead.

Pulpcore version:
python3-pulpcore-3.14.3-1.el8.noarch

Pulp plugins installed and their versions:
python3-pulp-rpm-3.14.0-1.el8.noarch

Operating system - distribution and version:
RHEL 8.5

@wiad, all content is immutable, so you should not be able to change it. However you should be able to remove content or create a new one.

In theory, you can create your own module-defaults file (it should be in a format of modules.yaml of repository metadata) and upload it to pulp with this API endpoint.

http --form POST "https://<your.pulp.com>/pulp/api/v3/content/rpm/modulemd_defaults/ \
    file@<path to your file with new module-defaults> \
    repository=<href of a repo you want to upload to> \
    module=<module name> \
    stream=<default stream> \
    profiles=<profiles if any>

I do no think this has been used much and it looks to me that the API can be improved, e.g. provide a file only and get all the details from there without asking to provide it in the parameters to the REST API call.
Alternatively, if the use case is as simple as “set a stream B as a default of module A for this repo and I do not care about profiles”, maybe it deserves a separate endpoint. Let’s see what others think.

1 Like