Correctly identify AlmaLinux

Problem:

AlmaLinux is identified as unknown OS

Expected outcome:

Correctly identify AlmaLinux

Foreman and Proxy versions:

  • Foreman 2.5.2

Foreman and Proxy plugin versions:

  • candlepin-4.0.6-1.el8.noarch
  • candlepin-selinux-4.0.6-1.el8.noarch
  • foreman-2.5.2-1.el8.noarch
  • foreman-cli-2.5.2-1.el8.noarch
  • foreman-debug-2.5.2-1.el8.noarch
  • foreman-dynflow-sidekiq-2.5.2-1.el8.noarch
  • foreman-installer-2.5.2-3.el8.noarch
  • foreman-installer-katello-2.5.2-3.el8.noarch
  • foreman-postgresql-2.5.2-1.el8.noarch
  • foreman-proxy-2.5.2-1.el8.noarch
  • foreman-release-2.5.2-1.el8.noarch
  • foreman-service-2.5.2-1.el8.noarch
  • katello-4.1.2.1-1.el8.noarch
  • katello-certs-tools-2.7.3-1.el8.noarch
  • katello-client-bootstrap-1.7.6-1.el8.noarch
  • katello-common-4.1.2.1-1.el8.noarch
  • katello-debug-4.1.2.1-1.el8.noarch
  • katello-default-ca-1.0-1.noarch
  • katello-repos-4.1.2.1-1.el8.noarch
  • katello-server-ca-1.0-1.noarch
  • katello.comtec.lan-apache-1.0-1.noarch
  • katello.comtec.lan-foreman-client-1.0-1.noarch
  • katello.comtec.lan-foreman-proxy-1.0-1.noarch
  • katello.comtec.lan-foreman-proxy-client-1.0-1.noarch
  • katello.comtec.lan-puppet-client-1.0-1.noarch
  • pulp-client-1.0-1.noarch
  • python3-pulp-ansible-0.9.0-1.el8.noarch
  • python3-pulp-certguard-1.4.0-1.el8.noarch
  • python3-pulp-container-2.7.1-1.el8.noarch
  • python3-pulp-deb-2.14.1-1.el8.noarch
  • python3-pulp-file-1.8.1-1.el8.noarch
  • python3-pulp-rpm-3.14.0-1.el8.noarch
  • python3-pulpcore-3.14.3-1.el8.noarch
  • qpid-proton-c-0.32.0-3.el8.x86_64
  • rubygem-foreman-tasks-4.1.2-1.fm2_5.el8.noarch
  • rubygem-foreman-tasks-core-0.3.6-1.fm2_5.el8.noarch
  • rubygem-foreman_maintain-0.8.6-1.el8.noarch
  • rubygem-foreman_remote_execution-4.5.4-1.fm2_5.el8.noarch
  • rubygem-foreman_remote_execution_core-1.4.4-1.el8.noarch
  • rubygem-hammer_cli-2.5.1-1.el8.noarch
  • rubygem-hammer_cli_foreman-2.5.1-1.el8.noarch
  • rubygem-hammer_cli_foreman_remote_execution-0.2.1-2.fm2_5.el8.noarch
  • rubygem-hammer_cli_foreman_tasks-0.0.15-2.fm2_5.el8.noarch
  • rubygem-hammer_cli_katello-1.1.2-1.el8.noarch
  • rubygem-katello-4.1.2.1-1.el8.noarch
  • rubygem-pulp_ansible_client-0.8.0-1.el8.noarch
  • rubygem-pulp_certguard_client-1.4.0-1.el8.noarch
  • rubygem-pulp_container_client-2.7.0-1.el8.noarch
  • rubygem-pulp_deb_client-2.13.0-1.el8.noarch
  • rubygem-pulp_file_client-1.8.1-1.el8.noarch
  • rubygem-pulp_rpm_client-3.13.3-1.el8.noarch
  • rubygem-pulpcore_client-3.14.1-1.el8.noarch
  • rubygem-qpid_proton-0.32.0-3.el8.x86_64
  • rubygem-smart_proxy_pulp-3.0.0-1.fm2_5.el8.noarch

Distribution and version:
CentOS 8.4

Other relevant data:

Well, my bad, the OS entry from Hosts/ Operating Systems was not configured correctly.
Rookie mistake.

Could you please share how you set that correctly? In case someone else hits this.

How does Foreman assign an Operating System to a newly registered host? I have the Hosts > Operating System defined as AlmaLinux 8.4 but newly registered AlmaLinux systems end up as Unknown 8.4 systems (even though the Operating System definition is present).

This should be fixed as part of Foreman 2.5.1:
https://projects.theforeman.org/issues/31787

Which version are you on @mclausen?

1 Like

Foreman 2.5.2 with Katello 4.1.2.1

It seems that I have rushed with conclusions, unfortunately it’s not fixed in my case.

Do foreman get the information from facter?

If so in the AlmaLinux case facter reports this

# facter os

{
  architecture => "x86_64",
  family => "RedHat",
  hardware => "x86_64",
  name => "RedHat",
  release => {
    full => "8.4",
    major => "8",
    minor => "4"
  },
  selinux => {
    enabled => false
  }
}

On the other hand for a CentOS machine it reports

# facter os

{
  architecture => "x86_64",
  family => "RedHat",
  hardware => "x86_64",
  name => "CentOS",
  release => {
    full => "8.4.2105",
    major => "8",
    minor => "4"
  },
  selinux => {
    enabled => false
  }
}

As you can see Alma is reported as Redhat, maybe this is an issue in case foreman keeps track of facter info.

Works for me:

# facter os
{
  architecture => "x86_64",
  family => "RedHat",
  hardware => "x86_64",
  name => "AlmaLinux",
  release => {
    full => "8.4",
    major => "8",
    minor => "4"
  },
  selinux => {
    config_mode => "enforcing",
    config_policy => "targeted",
    current_mode => "enforcing",
    enabled => true,
    enforced => true,
    policy_version => "33"
  }
}

Are the release files correct?

# rpm -V almalinux-release

What do you have in /etc/os-release and /etc/redhat-release?

Which version of Facter are you using? I forgot the exact version that added it, but you must ensure that’s new enough as well.

 rpm -qa | grep facter
facter-3.14.2-4.el8.x86_64
cat /etc/os-release

NAME="AlmaLinux"
VERSION="8.4 (Electric Cheetah)"
ID="almalinux"
ID_LIKE="rhel centos fedora"
VERSION_ID="8.4"
PLATFORM_ID="platform:el8"
PRETTY_NAME="AlmaLinux 8.4 (Electric Cheetah)"
ANSI_COLOR="0;34"
CPE_NAME="cpe:/o:almalinux:almalinux:8.4:GA"
HOME_URL="https://almalinux.org/"
DOCUMENTATION_URL="https://wiki.almalinux.org/"
BUG_REPORT_URL="https://bugs.almalinux.org/"

ALMALINUX_MANTISBT_PROJECT="AlmaLinux-8"
ALMALINUX_MANTISBT_PROJECT_VERSION="8.4"
cat  /etc/redhat-release
AlmaLinux release 8.4 (Electric Cheetah)

rpm -qa almalinux-release
almalinux-release-8.4-3.el8.x86_64

Maybe facter is the issue, I’m not really sure how old it is. What version do you have?

This added support to 3.x
https://github.com/puppetlabs/facter/commit/1237cfae360d233b89e0f1f8d435999479b1d553

$ git tag --contains 1237cfae360d233b89e0f1f8d435999479b1d553
3.14.17
3.14.18

So you really need one of the latest facter versions.

So the issue in this case is facter? That data that foreman has are from facter?

At least when you use Puppet. There are other fact sources (subscription-manager can be used with Katello). Those must be up to date as well.

O.K. I always install puppet-agent from puppetlabs (6.24.0) which comes with facter 3.14.19. Never used the one from epel.

I double checked and I’m also using Puppet Agent v6.24.0 with facter 3.14.19. Here is how it is reporting on the OS:

facterversion => 3.14.19

os => {
  architecture => "x86_64",
  distro => {
    codename => "ElectricCheetah",
    description => "AlmaLinux release 8.4 (Electric Cheetah)",
    id => "AlmaLinux",
    release => {
      full => "8.4",
      major => "8",
      minor => "4"
    },
    specification => ":core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch"
  },
  family => "RedHat",
  hardware => "x86_64",
  name => "AlmaLinux",
  release => {
    full => "8.4",
    major => "8",
    minor => "4"
  },
  selinux => {
    config_mode => "enforcing",
    config_policy => "targeted",
    current_mode => "enforcing",
    enabled => true,
    enforced => true,
    policy_version => "33"
  }
}

I also checked the /etc/redhat-release file and it’s properly showing as AlmaLinux as well:

AlmaLinux release 8.4 (Electric Cheetah)

Here’s the os-release file, just for completeness:

NAME="AlmaLinux"
VERSION="8.4 (Electric Cheetah)"
ID="almalinux"
ID_LIKE="rhel centos fedora"
VERSION_ID="8.4"
PLATFORM_ID="platform:el8"
PRETTY_NAME="AlmaLinux 8.4 (Electric Cheetah)"
ANSI_COLOR="0;34"
CPE_NAME="cpe:/o:almalinux:almalinux:8.4:GA"
HOME_URL="https://almalinux.org/"
DOCUMENTATION_URL="https://wiki.almalinux.org/"
BUG_REPORT_URL="https://bugs.almalinux.org/"

ALMALINUX_MANTISBT_PROJECT="AlmaLinux-8"
ALMALINUX_MANTISBT_PROJECT_VERSION="8.4"

Now I use the bootstrap.py script to register my clients, not sure if that is causing something weird to happen, but I have tried a few permutations where I re-register in place, delete the system then register, etc… but it always comes in as Unknown 8.4.

Well, I guess to comes down to why you have the facter rpm from epel installed as well. I don’t have that I guess that the client will use a search path to find the facter executable and prefers /usr/bin to /opt/puppetlab/bin which runs the old facter version in your case…

Please file a Bugzilla against EPEL8 to update Facter to 3.14.19. That will avoid problems for other users as well.

Except I don’t have the EPEL version of facter installed. The only facter I have on this system is the one that comes with the Puppet Agent. Should I have both installed (Puppet and EPEL)?

You wrote before:

That is the EPEL 8 facter. How did you install it?

Maybe check with dnf history list facter.

That was someone else, here’s my RPM output:

[LEBANON][11:02:35 EDT] # rpm -qa | grep facter