Provisioned hosts with CentOS8 Stream change os after first puppet run

Problem:
In foreman 1.23.1 I create a new Operating System: CentOS8Stream and associate the media (mirror) and partition tables and the 3 kickstart files. All works fine for the hosts provisioning.
When puppet run for the fisrt time in the provisioned host the OS change in generic CentOS.
The facter in the povisioned host is:

os => {
architecture => “x86_64”,
family => “RedHat”,
hardware => “x86_64”,
name => “CentOS”,
release => {
full => “8”,
major => “8”
},
selinux => {
enabled => true
}
}

There is a way to set the OS name to CentOS8Stream or CentOSStream or CentOS Stream so foreman keep the correct OS for that host in the web interface?

Expected outcome:
In web interface keep the OS CentOS8 Stream or CentOS8Stream

Foreman and Proxy versions:
1.23.1

Foreman and Proxy plugin versions:

Distribution and version:
CentOS7 backend mariadb/mysql

Other relevant data:

Anyone have any idea what could be causing this?

CentOS 8 and CentOS 8 Stream hosts do report back as the very same operating systems. This is how Puppet Facter reports them back and they are, in fact, very same. The upstream project, CentOS, will unlikely be rebranding the OS to something else than CentOS, it is not changing what is changing is cadence of updates.

If you don’t like Foreman updating the OS association, there is an Administer - Setting - Update OS from facts setting (I do not remember the exact name). You can turn off this behavior.

I understand this can make the transition harder, but I cannot figure out what we could possibly do to make it easier for you. But this is not the first time somebody struggles with this, maybe we could implement a set of fact names which would override the OS when defined via custom fact.

1 Like

I think we could actually tell CentOS Stream apart from CentOS Linux, because apparently Stream does not report minor version. Perhaps this is something we can handle in the fact parser?

1 Like

We can patch it up by looking at the distro ID (may need lsb-release-core installed, depending on the Facter version) like we do here:

However, you are on an unsupported Foreman version that won’t receive any updates.

https://tickets.puppetlabs.com/browse/FACT-2134 is the related bug for Facter.

But the problem is, there is no official name CentOS Stream, I think CentOS remains CentOS and the legacy version will disappear. If we do that, then we will end up with “CentOS Stream” OS name forever while the world will eventually move on and settle on just CentOS.

The same concerns were raised in Facter however it looks like there is no other way than introducing a new name. There is a patch merged into Facter 4.x now that introduces CentOSStream OS.

I think we need to do:

  • Recognize the new Facter’s OS.
  • Implement the hack for legacy facter versions.
  • Making sure both work the same way (landing on the very same OS so upgrade of facter wont break it).
  • Adding tests with fixtures for all cases (CentOS 8, CentOS 8 Stream with old and patched facter).

Correction, the patch was reverted as a breaking change since it changes OS name and many modules do expect it to be “CentOS” to perform various checks. So the recommended way to differentiate them now is via the following fact:

# on CentOS Linux
❯ facter os.distro.id
CentOS


# on CentOS Stream 
❯ facter os.distro.id
CentOSStream

We can use this instead of the missing minor version I guess. We still need to do what I suggested however.

For the record, I have collected Puppet 2.5 and 4.0 output (could not install 3.0 due to missing development files) and Ansible 2.9 and made JSON exports of a node before and after migration from CentOS 8 to Stream. I am not sure if I will have time for a full patch so I will attach these somewhere. Here is a diff:

[root@stream ~]# diff centos8-legacy-facter-4.1.json centos8-stream-facter-4.1.json
139,140c139,140
<       "description": "CentOS Linux release 8.3.2011",
<       "id": "CentOS",
---
>       "description": "CentOS Stream release 8",
>       "id": "CentOSStream",
142,144c142,143
<         "full": "8.3.2011",
<         "major": "8",
<         "minor": "3"
---
>         "full": "8",
>         "major": "8"
151,153c150,151
<       "full": "8.3.2011",
<       "major": "8",
<       "minor": "3"
---
>       "full": "8",
>       "major": "8"

centos-stream-facter.tar.gz (11.4 KB)

Just to let you know, we are still working on the patch, it got little bit delayed but hopefully there will be solution soon.

1 Like