[sles-beta] Problem with facter BUG in SLES11 facter version 1.5.2

urs.frey at post.ch urs.frey at post.ch
Mon Mar 11 08:56:13 MDT 2013


Dear all

We do have an issue with the facter version in SLES11-SP2 & SLES11-SP3 facter-1.5.2-1.20

h04szd:~ # uname -a
Linux h04szd 3.0.65-0.9-default #1 SMP Mon Feb 25 07:21:23 UTC 2013 (055263a) x86_64 x86_64 x86_64 GNU/Linux
h04szd:~ # cat /etc/SuSE-release
SUSE Linux Enterprise Server 11 (x86_64)
VERSION = 11
PATCHLEVEL = 3
h04szd:~ # rpm -qa | grep facter
facter-1.5.2-1.20
h04szd:~ #

It is a known bug , known by puppetlabs and documented here:
http://projects.puppetlabs.com/issues/7039

When declaring several facts in a single file, Facter won't pick them up properly:
It is easy to reproduce:
h04szd:~ # cat test_facts.rb
# test_facts.rb
Facter.add(:test_fact1) do
    setcode do
        "test fact 1"
    end
end

Facter.add(:test_fact2) do
    setcode do
        "test fact 2"
    end
end

h04szd:~ #
h04szd:~ # export FACTERLIB=/root/
h04szd:~ # facter | grep test
test_fact1 => test fact 1
test_fact2 => test fact 2
h04szd:~ #

Now when trying to retrieve one of these facts, facter does not work
h04szd:~ # facter --version
1.5.2
h04szd:~ # facter test_fact1
h04szd:~ # facter test_fact2

facter does not work with several facts declared, because the declaration file needs to be named exactly the way the fact is called in this existing version of facter on SLES11:
If I have only one fact declared in one file:
h04szd:~ # ll test_fact1.rb
-rw-r--r-- 1 root root 92 Mar 11 15:34 test_fact1.rb
h04szd:~ # cat test_fact1.rb
# test_facts.rb
Facter.add(:test_fact1) do
    setcode do
        "test fact 1"
    end
end
h04szd:~ # facter test_fact1
test fact 1
h04szd:~ #



When doing the very same test on a newer facter version this  multi declaration of facts in only one file works
[root at vtst1a ~]# cat test_facts.rb
# test_facts.rb
Facter.add(:test_fact1) do
    setcode do
        "test fact 1"
    end
end

Facter.add(:test_fact2) do
    setcode do
        "test fact 2"
    end
end

[root at vtst1a ~]#
[root at vtst1a ~]# facter --version
1.6.4
[root at vtst1a ~]# facter test_fact1
test fact 1
[root at vtst1a ~]# facter test_fact2
test fact 2
[root at vtst1a ~]#

Would there be a lot of work, if I ask kindly to update, or fix this bug, by an appropriate backport?
For us here it would save us a lot of work in creating our own private facter-RPM and update the entire platform of several hundred servers to our own private RPM package.
I mean , we would need to create updates for the entire private puppet packages and the find a way to remotely remove the SLES facter package and install the newly created private facter package.

Thanks for considering this problem

Best regards

Urs Frey
Die Schweizerische Post
Services
Informationstechnologie
Webergutstrasse 12
3030 Bern (Zollikofen)
Telefon : ++41 (0)58 338 58 70
FAX     : ++41 (0)58 667 30 07
E-Mail:   urs.frey at post.ch<mailto:urs.frey at post.ch>




More information about the sles-beta mailing list