Subscription Manager distributes wrong OS information


When I register my Ubuntu 22.04-Client with the subscription-manager the hosts gets attached a newly created Operating System in Foreman. The reason for this, is that the subscription-manger facts do not include the minor version of the OS. That’s why in Foreman the Major and Minor version differ from the values on the manually created operating system and therefore foreman does not refer to the correct operating system.

Is this a known bug, that gets fixed in the future or is there already a workaround?

This is a screenshot of the os that is created when i register my client with the subscription-manager

When I want to reprovision my client, I first need to change the operating system cause otherwise all the templates are not attached correctly

Expected outcome:
The OS I already attached to the Client via the foreman web gui should not be changed. And the versioning should look like this

Foreman and Proxy versions:
Foreman and Proxy plugin versions:

katello 4.12
Distribution and version:
Centos Stream 8 (foreman)
Ubuntu 22.04.4 (client)
Other relevant data:

subscription-manager version 1.29.35

This is a short snippet of the subscription-manager facts


1 Like

I can’t make a judgement call if this works as intended or is a bug, but you should be able to suppress/disable this behavior via the “Ignore facts for operating system” setting (Administer → Settings → Facts).

Setting this to “Yes” should disable host OS being changed when facts are uploaded.


IMO this is a bug. Currently when the version passed by subscription-manager is parsed by Foreman it is split at the dots and the first and second split parts are used as major and minor version. Further split parts are discarded (see rhsm_fact_parser.rb#L55). For Ubuntu this is wrong as 22.04.3 should be split into 22.04 as major and 3 as minor version.
I opened a PR to fix this on the Foreman side so that the Ubuntu version scheme is parsed correctly. Unfortunately I was busy with other things the last time, but I will head back to this PR as soon as possible.

Note: But this is just one part as this has to be fixed on the client side, too. subscription-manager gathers facts from the /etc/os-release file (see The VERSION_ID field is used for passing the version to Foreman. For Ubuntu (and also for Debian) the VERSION_ID only contains the major version. Therefore, for Ubuntu versions (and Debian versions) to be detected correctly, subscription-manager has to be fixed, too. A possible fix could be to use the VERSION field of the /etc/os-release file for Ubuntu and the /etc/debian_version file for Debian.