Open nf-brentsaner opened 1 month ago
@nf-brentsaner Just ran lsb_release -a
and got Release: 12
no minor version, but will check later again once updated the VM used. Cannot provide a minor version if lsb_release -a
is not giving one, and btw: cat /etc/os-release
also did not provide a minor version either.
Note: /etc/debian_version is where the minor is
@nf-brentsaner I understand where the /etc/debian_version is where the minor version is, but the grains for Debian / Ubuntu platforms make use of lsb_release, which is providing the information. It used to provide the minor version, thinking back to 8.6 being reported, but it is now only reporting major versions
What then is the purpose of thenosrelease*
grains vs lsb_release_*
grains?
@nf-brentsaner Not all platforms have lsb_release support, so osrelease grains are there in general, and lsb_release also provided on those platforms which do. The grains handling for operating systems was re-architected a few years ago, to more accurately utilize the information provided by the OS, that is /etc/os-release etc.
The fact that Debian and lsb_release or /etc/os-release on Debian 12 is no longer providing minor versions is beyond the control of Salt, esp. when it used to, go look at stretch
. Given the minimal resources and time available to the Salt Core Team, a PR addressing the issue with unit tests and changelog would be much appreciated which resolves the matter for Debian and Ubuntu, noting that on Ubuntu:
trixie/sid
david@david-XPS-15-9570:~/devcode/dgm_salt_3006/salt$ cat /etc/os-release
PRETTY_NAME="Ubuntu 24.04.1 LTS"
NAME="Ubuntu"
VERSION_ID="24.04"
VERSION="24.04.1 LTS (Noble Numbat)"
VERSION_CODENAME=noble
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=noble
LOGO=ubuntu-logo
david@david-XPS-15-9570:~/devcode/dgm_salt_3006/salt$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 24.04.1 LTS
Release: 24.04
Codename: noble
david@david-XPS-15-9570:~/devcode/dgm_salt_3006/salt$
Note: Ubuntu trixie/sid
And understand this not reporting minor version has been around since Debian 10, but missed. So first to notice this, thanks for bringing it to attention.
Also wanted to draw your attention to the understanding on using /etc/os-release, https://github.com/saltstack/salt/blob/58c89a8dfd8837a809d7d1bedf5609ad64d39652/salt/grains/core.py#L2221-L2224
As for Rocky 9, and suggestion on osfinger, there is no information as to patch level etc in /etc/os-release
[root@ip-10-2-4-75 rocky]# cat /etc/os-release
NAME="Rocky Linux"
VERSION="9.4 (Blue Onyx)"
ID="rocky"
ID_LIKE="rhel centos fedora"
VERSION_ID="9.4"
PLATFORM_ID="platform:el9"
PRETTY_NAME="Rocky Linux 9.4 (Blue Onyx)"
ANSI_COLOR="0;32"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:rocky:rocky:9::baseos"
HOME_URL="https://rockylinux.org/"
BUG_REPORT_URL="https://bugs.rockylinux.org/"
SUPPORT_END="2032-05-31"
ROCKY_SUPPORT_PRODUCT="Rocky-Linux-9"
ROCKY_SUPPORT_PRODUCT_VERSION="9.4"
REDHAT_SUPPORT_PRODUCT="Rocky Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="9.4"
For Ubuntu 24.04
root@ip-10-2-5-97:/home/ubuntu# cat /etc/os-release
PRETTY_NAME="Ubuntu 24.04.1 LTS"
NAME="Ubuntu"
VERSION_ID="24.04"
VERSION="24.04.1 LTS (Noble Numbat)"
VERSION_CODENAME=noble
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=noble
LOGO=ubuntu-logo
For osfinger suggestion, could grab the 24.04.1 for patch level etc. If interested in this, then please add a 'Feature Request' against the master branch for the added functionality, detailing the additional functionality and how it would work on RedHat, Debian/Ubuntu, Windows and MacOS families.
Description See below; Debian does not include minor version in grains.
Setup N/A
Steps to Reproduce the behavior
Yet, e.g.:
Expected behavior e.g. on AlmaLinux:
Both the major and minor are available via
lsb_distrib_release
,osrelease
, andosrelease_info
. (One may argue theosfinger
should include any minor/patch/revision version info as well, but c'est la vie.)Screenshots N/A
Versions Report N/A, see above
Additional context N/A