Details
-
Bug
-
Status: Resolved
-
Normal
-
Resolution: Fixed
-
FACT 4.2.4
-
Night's Watch
-
1
-
NW - 2021-11-17
-
Needs Assessment
-
Bug Fix
-
Restore Facter3's value of 'os.name' for VirtuozzoLinux
-
Needs Assessment
Description
Facter 4.x changed the way the `os` facts are retrieved. Up to Facter 4.x (e.g. 3.14.20) `os.name` would return VirtuozzoLinux.
# facter --version
|
3.14.20 (commit 28fd6cc7adae74c7748502e4d18d34f75be92f93)
|
|
# facter os.name
|
VirtuozzoLinux
|
Starting with Facter 4.x `os.name` returns Virtuozzo instead.
# facter --version
|
4.2.5
|
|
# facter os.name
|
Virtuozzo
|
Content of `/etc/os-release` looks like this:
# cat /etc/os-release
|
NAME="Virtuozzo"
|
VERSION="7.5.1"
|
ID="virtuozzo"
|
ID_LIKE="rhel fedora"
|
VERSION_ID="7"
|
PRETTY_NAME="Virtuozzo release 7.5.1"
|
ANSI_COLOR="0;31"
|
CPE_NAME="cpe:/o:virtuozzoproject:vz:7"
|
HOME_URL="http://www.virtuozzo.com"
|
BUG_REPORT_URL="https://bugs.openvz.org/"
|
Changing `NAME=` to VirtuozzoLinux makes Facter return the "correct" value which is used by community modules (e.g. 'voxpupuli/puppet-yum').
In order to avoid changing Puppet manifests, Hiera lookups, and various metadata files please restore the previous behavior / return value.
—
Side note: I tried overwriting `os.name` using a custom fact, but since Facter 4.1.0 (FACT-3004) it seems not working anymore - at least with this code (copied from a comment in FACT-2958):
Facter.add('os.name', type: :structured) do
|
has_weight(10)
|
setcode { 'custom_fact' }
|
end
|
Haven't tried yet changing the config option.
Is there any other method to overwrite core facts?