Display custom os facts / Amazon Linux 2

Hi there, I’ve installed subscription-manager on Amazon Linux 2, and when registering the system to Foreman, the Operating system on Foreman Interface shows as “Unknown 2”
The icon is also broken and show “icons16x16/black-%23.pngUnknown 2” On the host page, and show the operating system as Unknown 2 here :

So the major version is good but not the Main operating system.

Expected outcome:
Correct Amazon Linux OS reported

Foreman and Proxy versions:

  • foreman-2.0.3-1.el7.noarch
  • katello-3.15.3-1.el7.noarch

Distribution and version:
Katello is running on Cento

Other relevant data:
When checking the source code, I see :

        name = name.downcase
        if name =~ /red\s*hat/
        elsif name =~ /centos/
        elsif name =~ /fedora/
        elsif name =~ /sles/ || name =~ /suse.*enterprise.*/
        elsif name =~ /debian/
        elsif name =~ /ubuntu/
        elsif name =~ /oracle/

So I guess It’s normal that the OS shows up as Unkown ?
I also saw this commit adding the Debian family :

Can I do the same for the Amazon Linux ? Do you see a problem with that ?

Kind regards,


1 Like

I think a pull request for that makes sense.


I agree, maybe the code could use a bit of heuristic and it could try to capitalize the name and use that instead of Unknown as the last resort.

That’s a good idea, I could add that, I haven’t found yet how the logo is added besides the host, but we could imagine reusing the unknow logo for those who aren’t in the switch case

1 Like