Overview
Factor fact lsbdistcodename does not work out of the box on minimal OS installs due to the pe-facter package not specifying a dependency on the package providing the lsb_release command.
Affected platforms:
-
Debian (tested 8.0/Jessie – after a forced install of PE agent)
-
Centos (tested 6.5 - trainingvm)
-
Probably more
Expected result
/opt/puppet/bin/facter lsbdistcodename
|
Should always print the LSB release code name
Actual result
Command output is dependent on supplementary packages being installed. On a minimal OS installation a blank line is printed:
[root@master tmp]# /opt/puppet/bin/facter lsbdistcodename
|
|
Packaging info
CentOS
[root@master tmp]# rpm -q --requires pe-facter
|
/opt/puppet/bin/ruby
|
dmidecode
|
pciutils
|
pe-ruby
|
pe-virt-what
|
rpmlib(CompressedFileNames) <= 3.0.4-1
|
rpmlib(FileDigests) <= 4.6.0-1
|
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
|
rpmlib(VersionedDependencies) <= 3.0.3-1
|
which
|
rpmlib(PayloadIsXz) <= 5.2-1
|
Debian
geoff@jenkins:~$ dpkg -s pe-facter
|
Package: pe-facter
|
Status: install ok installed
|
Priority: optional
|
Section: ruby
|
Installed-Size: 388
|
Maintainer: Puppet Labs <in...@puppetlabs.com>
|
Architecture: amd64
|
Version: 2.3.0.2-1puppet1
|
Depends: pe-ruby, dmidecode, pe-virt-what, pciutils
|
Description: Ruby module for collecting simple facts about a host operating system
|
Some of the facts are preconfigured, such as the hostname and the operating
|
system. Additional facts can be added through simple Ruby scripts.
|
Homepage: http://www.puppetlabs.com
|
Problems this causes
Modules that expect to have the $::lsbdistcodename fact available fail in production in mysterious ways and facter itself gives no information or warning on how to resolve things. I was only able to figure out what was broken by looking at the source code.
I personally witnessed puppetlabs/java failing on Debian with a message that the operating system is not supported. This was resolved by installing the required package.
Condition diagnosis
To confirm you are affected by this issue, run the command:
/opt/puppet/bin/facter lsbdistcodename
|
If you do not see any output, you are missing the lsb_release program
Workaround
Debian
apt-get install lsb_release
|
CentOS/RHEL
yum install redhat-lsb-core
|
After installing these packages, the fact will work although on CentOS 6.5 it just displays the word Final which is all that is available via the lsb_release command.
|