Auto-create OS based on facts -> Switch to Major version only?

Currently, when a new machine is registered (or, when ignore_facts_for_operatingsystem=false, after a while™ ) new OSes start to turn up in the Operating Systems list.

E.g. Rocky 8.5 etc.

However, in my situation this breaks some deployment related settings, as I have Ansible only define them for the OS major version (so, Rocky 8).

I have successfully worked around this by setting ignore_facts_for_operatingsystem to true for all machines that are deployed by Foreman, so they’ll stick to Rocky 8 as their OS with all the settings I’ve made.

Except when I manually register a system that’s been freshly installed from the ISO. Because the VERSION_ID in /etc/os-release is set as 8.5 Foreman then continues to create that OS in the registration proces. Which then allows other machines to also become set to that OS version and break everything again :frowning:

Is there, except editing /etc/os-release to remove the .5 from the VERSION_ID a way of telling Foreman to not do that? :slight_smile: (IMHO, I never used any of the auto-detected OSes, so I could do without, but I’m not sure if other folks around use it).

To clarify, I’d like Foreman to stop considering all the minor versions as actual OSes (CentOS7 was a nightmare with the gazillion minor versions that were detected). Just stick to majors :slight_smile:

Expected outcome:
Not automatically break OS re-deployment for existing machines :wink:

I believe that Foreman is no longer just a puppet inventory and modifying records based off facts is a long-term pain that should be solved:

1 Like