Facter : no operatingsystemrelease on CentOS 7

703 views
Skip to first unread message

Claude

unread,
May 26, 2015, 12:32:20 PM5/26/15
to puppet...@googlegroups.com
Hi,

I'm testing the Openstack CentOS 7 image with Puppet 3.7.5. My problem is with Facter not identifying correctly the operating system :

[root@test2 vendor_ruby]# facter --version
2.4.4

[root@test2 vendor_ruby]# ruby --version
ruby 2.0.0p598 (2014-11-13) [x86_64-linux]

[root@test2 vendor_ruby]# cat /etc/redhat-release
Derived from Red Hat Enterprise Linux 7.1 (Source)

[root@test2 vendor_ruby]# uname -a
Linux centos2 3.10.0-229.el7.x86_64 #1 SMP Fri Mar 6 11:36:42 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

[root@test2 vendor_ruby]# facter operatingsystemrelease -d
Confine raised NoMethodError undefined method `[]' for nil:NilClass
Found no suitable resolves of 1 for operatingsystemrelease
value for operatingsystemrelease is still nil

[root@test2 ~]# facter os
{"name"=>"RedHat", "family"=>"RedHat"}

I noticed that the CentOS image doesn't contain the command lsb_release so I installed it (with yum install redhat-lsb-core) and ran the test again : now I get more detail in the os variable but operatingsystemrelease is always empty:

[root@test2 ~]# facter operatingsystemrelease -d
Confine raised NoMethodError undefined method `[]' for nil:NilClass
Found no suitable resolves of 1 for operatingsystemrelease
value for operatingsystemrelease is still nil

[root@test2 ~]# facter os -d
{"name"=>"RedHat", "family"=>"RedHat", "lsb"=>{"distcodename"=>"Core", "distid"=>"CentOS", "distdescription"=>"CentOS Linux release 7.1.1503 (Core) ", "release"=>":core-4.1-amd64:core-4.1-noarch", "distrelease"=>"7.1.1503", "majdistrelease"=>"7", "minordistrelease"=>"1"}}


Poil

unread,
May 26, 2015, 2:06:48 PM5/26/15
to puppet...@googlegroups.com
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/01686988-6848-463a-a35b-cda9de0c5d8d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Claude

unread,
May 26, 2015, 2:28:26 PM5/26/15
to puppet...@googlegroups.com
I just found out about the source of the bug : https://tickets.puppetlabs.com/browse/FACT-893.

Indeed a yum update solves the problem but since I must run puppet before that, I found the following workaroud is also valid:

ln -s -f /etc/centos-release /etc/redhat-release

Thanks

Poil

unread,
May 26, 2015, 2:38:56 PM5/26/15
to puppet...@googlegroups.com
If you install from an ISO, redownload it
Reply all
Reply to author
Forward
0 new messages