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
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).
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 hwprobe.py#L147). 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.