I’m in the process of adding in additional repositories into my foreman content library.
This has been pretty straightforward for repositories that provide a URL natively, but some, such as Graylog-Sidecar which are normally installed via a .RPM file have been giving me some challenges.
For example, Graylog-Sidecar, is normally installed via these steps
Not sure about “the best way of handling this”, but one approach we sometimes use, is to install the RPM that adds some repo file, and then clearing said repo file (replacing the entire content with something like):
# This yum repository needs to be empty so that only Foreman supplied repos are used!
Seperately we make sure the required repo is available on Foreman.
As mentioned, I would recomment using rpm2cpio package | cpio -idmv and then just fetching it from the extracted files.
The path where you can find the repo files is etc/yum.repos.d relative to where you extracted the rpm.
We then just copy the URL from the repo config in those files.
The advantage of simply installing the RPM and then clearing/commenting out the repo file, is that it is now impossible for that RPM to be installed accidentally later on (any further installs or upgrades of the RPM won’t change your modified/cleared/commented out repo file). That way you prevent a case where some dependency or well meant yum action suddenly adds a repo file that bypasses your Katello content.
But I guess this approach is nevertheless still a hack…