Project

General

Profile

Bug #13964

Os name for sles 12 is not correct in 5.0 inventories

Added by Félix DALLIDET 5 months ago. Updated 4 months ago.

Status:
Released
Priority:
N/A
Category:
Agent
Target version:
Severity:
User visibility:
Effort required:
Priority:
0

Description

When running a scenario on a sles12 machine with RTF, the initial tests contain an inventory sample test.
It fails because the OS_NAME is '%s' which is for sure not wanted.
It was seen on a 5.0.4

     <HARDWARE>
      <ARCHNAME>x86_64-linux-thread-multi</ARCHNAME>
      <CHASSIS_TYPE>Other</CHASSIS_TYPE>
      <CHECKSUM>131071</CHECKSUM>
      <DATELASTLOGGEDUSER>Wed Dec 12 16:34</DATELASTLOGGEDUSER>
      <DNS>8.8.8.8/8.8.4.4</DNS>
      <ETIME>1</ETIME>
      <IPADDR>10.0.2.15/192.168.41.2</IPADDR>
      <LASTLOGGEDUSER>vagrant</LASTLOGGEDUSER>
      <MEMORY>1481</MEMORY>
      <NAME>server</NAME>
      <OSCOMMENTS>#1 SMP Tue May 29 21:04:44 UTC 2018 (cd0437b)</OSCOMMENTS>
      <OSNAME>%s</OSNAME>
      <OSVERSION>4.12.14-23-default</OSVERSION>
      <PROCESSORN>1</PROCESSORN>
      <PROCESSORT>Intel Core Processor (Haswell, no TSX)</PROCESSORT>
      <UUID>3DB5964D-76A0-4374-B86F-9A2CC09CE8F9</UUID>
      <VMSYSTEM>VirtualBox</VMSYSTEM>
    </HARDWARE>

Associated revisions

Revision 4643369e (diff)
Added by Félix DALLIDET 5 months ago

Fixes #13964: Add support to os-release file in inventory

History

#1

Updated by Félix DALLIDET 5 months ago

  • Status changed from New to In progress
  • Assignee set to Félix DALLIDET
#2

Updated by Félix DALLIDET 5 months ago

  • Status changed from In progress to Pending technical review
  • Assignee changed from Félix DALLIDET to Nicolas CHARLES
  • Pull Request set to https://github.com/Normation/rudder-packages/pull/1739
#3

Updated by Félix DALLIDET 5 months ago

  • Subject changed from error in inventory on sles12 to Add support to os-release file in inventory
  • Assignee changed from Nicolas CHARLES to Félix DALLIDET
#4

Updated by Félix DALLIDET 5 months ago

  • Assignee changed from Félix DALLIDET to Nicolas CHARLES
#5

Updated by Félix DALLIDET 5 months ago

  • Status changed from Pending technical review to Pending release
#6

Updated by Vincent MEMBRÉ 4 months ago

  • Subject changed from Add support to os-release file in inventory to Os name for sles 12 is not correct in 5.0 inventories
#7

Updated by Vincent MEMBRÉ 4 months ago

  • Status changed from Pending release to Released
This bug has been fixed in Rudder 5.0.4 which was released today.
Changelog
#8

Updated by Félix DALLIDET 4 months ago

To give more details: starting from sles15, sles will only support /etc/os-release to identify the current os version.
See the doc of sles12 https://www.suse.com/releasenotes/x86_64/SUSE-SLES/12/#fate-316268.

I added support for /etc/os-release in our fusion inventory agent, following the current official fusion inventory agent.
But this seems to break compatibility on systems where inventory was previously based on a specific file like /etc/redhat-release but also have an /etc/os-release since the name, versions, etc... can be specified in different manners.

#9

Updated by Nicolas CHARLES 4 months ago

This breaks at least Redhat and SLES12 (both appears as Other Linux within rudder), and Centos which has version 7 (core) rather than 7.4

#10

Updated by Nicolas CHARLES 4 months ago

On SLES12
/etc/os-release

NAME="SLES" 
VERSION="12-SP1" 
VERSION_ID="12.1" 
PRETTY_NAME="SUSE Linux Enterprise Server 12 SP1" 
ID="sles" 
ANSI_COLOR="0;32" 
CPE_NAME="cpe:/o:suse:sles:12:sp1" 

/etc/SuSE-release

SUSE Linux Enterprise Server 12 (x86_64)
VERSION = 12
PATCHLEVEL = 1
# This file is deprecated and will be removed in a future service pack or release.
# Please check /etc/os-release for details about this release.

on Rudder pre-5.0.4, it returns SuSE, version 12.1
on Rudder post-5.0.4, it returns SUSE Linux Enterprise Server 12 SP1 - VERSION12-SP1

#11

Updated by Félix DALLIDET 4 months ago

On SLES 15:

NAME="SLES" 
VERSION="15" 
VERSION_ID="15" 
PRETTY_NAME="SUSE Linux Enterprise Server 15" 
ID="sles" 
ID_LIKE="suse" 
ANSI_COLOR="0;32" 
CPE_NAME="cpe:/o:suse:sles:15" 

Only another file, /etc/SUSE-brand

SLE
VERSION = 15

if lsb_release is installed:

server:/opt/rudder/lib/perl5/FusionInventory/Agent/Task/Inventory/Linux/Distro # lsb_release -a
LSB Version:    n/a
Distributor ID:    SUSE
Description:    SUSE Linux Enterprise Server 15
Release:    15
Codename:    n/a

Also available in: Atom PDF