[Pkg-puppet-devel] Bug#926197: facter: custom facts that aren't suitable override built-in facts

Aurelien Jarno aurel32 at debian.org
Mon Apr 1 20:38:03 BST 2019


Source: facter
Version: 3.11.0-1.1
Severity: important
Tags: upstream
Forwarded: https://tickets.puppetlabs.com/browse/FACT-1873

DSA is using facter with a small ruby fact to define operatingsystem for
GNU/kFreeBSD:

| Facter.add(:operatingsystem) do
|     confine :kernel => 'GNU/kFreeBSD'
|     setcode do
|         if FileTest.exists?("/etc/debian_version")
|             "Debian"
|        end
|     end
| end

When upgrading from the stretch to the buster version of Facter, this
small snippet actually hides the operatingsystem fact:

| 2019-04-01 10:50:20.906683 DEBUG puppetlabs.facter - fact "osfamily" has resolved to "Debian".
| 2019-04-01 10:50:20.906760 DEBUG puppetlabs.facter - fact "operatingsystemmajrelease" has resolved to "buster/sid".
| 2019-04-01 10:50:20.906821 DEBUG puppetlabs.facter - fact "operatingsystemrelease" has resolved to "buster/sid".
| 2019-04-01 10:50:20.906919 DEBUG puppetlabs.facter - fact "hardwaremodel" has resolved to "x86_64".
| 2019-04-01 10:50:20.906995 DEBUG puppetlabs.facter - fact "architecture" has resolved to "amd64".
| 2019-04-01 10:50:20.907062 DEBUG puppetlabs.facter - fact "lsbdistid" has resolved to "Debian".
| 2019-04-01 10:50:20.907131 DEBUG puppetlabs.facter - fact "lsbdistcodename" has resolved to "n/a".
| 2019-04-01 10:50:20.907197 DEBUG puppetlabs.facter - fact "lsbdistdescription" has resolved to "Debian GNU/Linux buster/sid".
| 2019-04-01 10:50:20.907266 DEBUG puppetlabs.facter - fact "lsbmajdistrelease" has resolved to "testing/unstable".
| 2019-04-01 10:50:20.907333 DEBUG puppetlabs.facter - fact "lsbdistrelease" has resolved to "testing/unstable".
| 2019-04-01 10:50:20.907401 DEBUG puppetlabs.facter - fact "operatingsystem" has resolved to "Debian".
| 2019-04-01 10:50:20.907471 DEBUG puppetlabs.facter - fact "selinux" has resolved to false.
| 2019-04-01 10:50:20.907546 DEBUG puppetlabs.facter - fact "os" has resolved to {
|   architecture => "amd64",
|   distro => {
|     codename => "n/a",
|     description => "Debian GNU/Linux buster/sid",
|     id => "Debian",
|     release => {
|       full => "testing/unstable",
|       major => "testing/unstable"
|     }
|   },
|   family => "Debian",
|   hardware => "x86_64",
|   name => "Debian",
|   release => {
|     full => "buster/sid",
|     major => "buster/sid"
|   },
|   selinux => {
|     enabled => false
|   }
| }.
| 2019-04-01 10:50:20.907640 DEBUG puppetlabs.facter - fact "operatingsystem" resolved to null and the existing value of "Debian" will be removed.
| 2019-04-01 10:50:20.909461 ERROR puppetlabs.facter - error while resolving custom facts in /var/lib/puppet/lib/facter/service_provider.rb: Could not autoload puppet/provider/service/freebsd: Could not autoload puppet/provider/service/init: undefined method `downcase' for nil:NilClass

It is first correctly defined, but then this ruby fact is overriding the
built-in operatingsystem fact. As the ruby fact is confined to a
different kernel, this should not happens.

It happens that this has been fixed reported and fixed upstream
recently: https://tickets.puppetlabs.com/browse/FACT-1873

Thanks to Apollon Oikonomopoulos for the help debugging this and on the
link to the upstream ticket.


More information about the Pkg-puppet-devel mailing list