Jira (FACT-2953) os codename should use parent os codename

15 views
Skip to first unread message

Corey Osman (Jira)

unread,
Mar 2, 2021, 9:50:03 PM3/2/21
to puppe...@googlegroups.com
Corey Osman created an issue
 
Facter / Bug FACT-2953
os codename should use parent os codename
Issue Type: Bug Bug
Affects Versions: FACT 3.y, FACT 4.y
Assignee: Unassigned
Created: 2021/03/02 6:49 PM
Priority: Normal Normal
Reporter: Corey Osman

I am using some lesser known distro derivatives of ubuntu and running into issues with how some of the core facts parse os information. Several modules don’t work when puppet installs packages since the distro codename is used instead of the upstream codename.  As an example the docker and puppet-agent fail to download packages because those modules rely on the apt module which configures an apt source with a codename that is only useful for the distro maintainer.

 

I think we should be referencing UBUNTU_CODENAME instead if available.

 

 

# created by the apt module (pisces is distro codename)
deb https://pe-std.puppet.vm:8140/packages/2019.8.5/ubuntu-18.04-amd64 pisces puppet6
 
# https://github.com/puppetlabs/puppetlabs-apt/blob/main/manifests/source.pp#L76
 
miner@4ccca5[192.168.2.18]~ more /etc/os-release
NAME="Ubuntu"
VERSION="18.04.5 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.5 LTS"
VERSION_ID="18.04"
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"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
 
 
miner@4ccca5[192.168.2.18]~ more /etc/lsb-release
DISTRIB_ID=MMP
DISTRIB_RELEASE=2.8.20
DISTRIB_CODENAME=pisces
DISTRIB_VARIANT=stable
DISTRIB_OPENCL=default
DISTRIB_DESCRIPTION="MMP 2.8.20 stable"

This ends up creating errors during package installation because the apt source is pointing to a package that does not exist and never will.  

 

 

Error: Could not update: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold --force-yes install puppet-agent=6.21.1-1pisces' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
W: --force-yes is deprecated, use one of the options starting with --allow instead.
E: Version '6.21.1-1pisces' for 'puppet-agent' was not found
Error: /Stage[main]/Puppet_agent::Install/Package[puppet-agent]/ensure: change from '6.21.1-1bionic' to '6.21.1-1pisces' failed: Could not update: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold --force-yes install puppet-agent=6.21.1-1pisces' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
W: --force-yes is deprecated, use one of the options starting with --allow instead.
E: Version '6.21.1-1pisces' for 'puppet-agent' was not found

 

This of course fails puppet and the node is unable to run.

The problem is facter is deriving the codename from the lsb-release file which should be reserved for lsbdistro facts only and not merged into the os.distro fact.  The codename should be bionic IMHO since that is what is found in /etc/os-release. 

 

This OS is a specialized distro for crypto mining purposes and there are dozens others just like it. I do not think making one off exceptions for all them is feasible. Instead supporting this pattern is a better approach when there is a upstream distro that it follows.  LinuxMint is the same way, but facter already has exceptions I believe.

 

 

1:>> $os
 => {
  "architecture" => "amd64",
        "distro" => {
       "codename" => "pisces",
    "description" => "MMP 2.8.20 stable",
             "id" => "MMP",
        "release" => {
       "full" => "2.8.20",
      "major" => "2.8",
      "minor" => "20"
    }
  },
        "family" => "Debian",
      "hardware" => "x86_64",
          "name" => "Ubuntu",
       "release" => {
     "full" => "18.04",
    "major" => "18.04"
  },
       "selinux" => {
    "enabled" => false
  }
}
 
3:>> $::lsbdistcodename
 => "pisces"
4:>> $::lsbdistdescription
 => "MMP 2.8.20 stable"
5:>> $::lsbdistid
 => "MMP"
6:>> $::lsbdistrelease
 => "2.8.20"
7:>> $::lsbmajdistrelease
 => "2.8"
8:>> $::lsbminordistrelease
 => "20"

 

I have not confirmed facter 4 has this issue, but facter 3 does.

The workaround for me is

ini_setting{'DISTRIB_CODENAME':
 ensure => present,
 path  => '/etc/lsb-release',
 value => 'bionic',
 setting => 'DISTRIB_CODENAME',
 before => Stage[main]
}

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Mihai Buzgau (Jira)

unread,
Mar 3, 2021, 1:48:03 AM3/3/21
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
Change By: Mihai Buzgau
Labels: community

Charlie Sharpsteen (Jira)

unread,
Mar 4, 2021, 12:03:03 PM3/4/21
to puppe...@googlegroups.com
Charlie Sharpsteen commented on Bug FACT-2953
 
Re: os codename should use parent os codename

Using VERSION_CODENAME to populate os.distro.codename if it is present in the os-release file seems reasonable to me as it is specified in the documentation for os-release:

https://man7.org/linux/man-pages/man5/os-release.5.html

Ciprian Badescu (Jira)

unread,
Jun 15, 2021, 5:10:02 AM6/15/21
to puppe...@googlegroups.com
Ciprian Badescu updated an issue
 
Change By: Ciprian Badescu
Labels: community help-wanted
This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo

Ciprian Badescu (Jira)

unread,
Jun 15, 2021, 5:11:01 AM6/15/21
to puppe...@googlegroups.com

Ciprian Badescu (Jira)

unread,
Jun 15, 2021, 5:11:03 AM6/15/21
to puppe...@googlegroups.com
Ciprian Badescu commented on Bug FACT-2953
 
Re: os codename should use parent os codename

Thank you for filing this issue. We agree it is likely an improvement, but due to other issues demanding precedence, we don’t anticipate being able to address this any time soon. If you are interested in submitting a patch to the repository for this project at https://github.com/puppetlabs, please open a pull request.

Corey Osman (Jira)

unread,
Apr 21, 2022, 3:41:02 PM4/21/22
to puppe...@googlegroups.com
Corey Osman commented on Bug FACT-2953

I can contribute this code.  Any specific file I should look in?  Is this a puppet or facter change.   Do I need to reopen the ticket or just reference it?

This message was sent by Atlassian Jira (v8.20.2#820002-sha1:829506d)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages