Project

General

Profile

Bug #33981

New OS created due to facts mismatch for operatingsystem for RHSM, Puppet and Ansible

Added by Marek Hulán 6 months ago. Updated 5 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Facts
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=2025437

Description of problem:
- When rhsm or puppet is sending facts for the OS it updates the facts to the name of "RedHat".
- If an Ansible role is later run it uses "RedHatEnterprise" (RHEL 8) or "RedHatEnterpriseServer" (RHEL 7).

Version-Release number of selected component (if applicable):
- Satellite 6.10.1

How reproducible:
- The OS is created automatically in Hosts => Operating Systems
- To check for the name go into each OS and check the Name field

Steps to Reproduce:
1. Register RHEl 8 client to Satellite
2. Run "subscription-manager facts --update"
3. The OS should be set to an OS which Name is "RedHat"
4. Run any playbook on the client that gathers facts
5. The OS for the client is updated to an OS that has "RedHatEnterprise" in its name

Actual Results:
If the option "ignore_facts_for_operating system" is set to "no" (default) the OS for a client is updated
to the last fact that was reported. This leads to the OS for a client to constantly switch between the
different OS and double the OS entries created than required.

Expected Results:
The Ansible reported fact for OS should be matched to the one that is reported by RHSM or Puppet.

Additional info:
- The fact matcher for Ansible seems to use ansible_lsb.id which delivers different values'


Related issues

Copied from Ansible - Bug #33980: New OS created due to facts mismatch for operatingsystem for RHSM, Puppet and AnsibleClosed

Associated revisions

Revision aeaad75c (diff)
Added by Marek Hulán 6 months ago

Fixes #33981 - fix the RHEL OS name parsing

When the parser lived in the foreman_ansible plugin, it started to
prefer the lsb facts over the distribution one, which is correct
behavior. See
https://github.com/theforeman/foreman_ansible/commit/ba50f37a00fb55c9695b5ef0cb80987f8eb532f8
for more details.

However the Red Hat Enterprise Linux is reported as either
RedHatEnterprise for RHEL 8 or RedHatEnterpriseServer or
RedHatEnterpriseWorkstation for RHEL 7. When user has more fact sources
like RHSM or Puppet, the host flips between 2 operating systems. This
add the additional mapping of these extra values.

It also adds anonymized facts snapshots from RHEL 7 and RHEL 8 machines.

History

#1 Updated by Marek Hulán 6 months ago

  • Copied from Bug #33980: New OS created due to facts mismatch for operatingsystem for RHSM, Puppet and Ansible added

#2 Updated by The Foreman Bot 6 months ago

  • Assignee set to Marek Hulán
  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/8943 added

#3 Updated by The Foreman Bot 6 months ago

  • Fixed in Releases 3.2.0 added

#4 Updated by Marek Hulán 6 months ago

  • Status changed from Ready For Testing to Closed

#5 Updated by Ondřej Ezr 5 months ago

  • Fixed in Releases 3.1.1 added

#6 Updated by Ondřej Ezr 5 months ago

  • Bugzilla link set to 2025437

Also available in: Atom PDF