Facter & Puppet disagree on RHEL 6?

323 views
Skip to first unread message

Aaron Grewell

unread,
Feb 20, 2013, 7:37:12 PM2/20/13
to puppet-users
I've run into an odd one on one of my new RHEL 6 boxes.  Puppet and Facter seem to disagree about the value of a fact. 

Puppet version: 2.7.9
Facter version: 1.6.4

Module: puppetlabs-apache

apache::params falls through its if structure:
 if $::osfamily == 'redhat' or $::operatingsystem == 'amazon' {
...
 } elsif $::osfamily == 'debian' {
...
 } else {
    fail("Class['apache::params']: Unsupported operatingsystem: $::operatingsystem or osfamily: $::osfamily")
  }  

The module returns the following error:
Error 400 on SERVER: Class['apache::params']: Unsupported operatingsystem: RedHat or osfamily: Linux

Facter, however, seems to think osfamily is 'RedHat' as it should be:
facter -p osfamily
RedHat

It's very strange.  Have any of you seen this one before?

Len Rugen

unread,
Feb 20, 2013, 8:08:27 PM2/20/13
to Puppet Users
CaSe SenSitiVe?  RedHat vs. redhat? 


--
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 post to this group, send email to puppet...@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Nick Fagerlund

unread,
Feb 20, 2013, 8:12:47 PM2/20/13
to puppet...@googlegroups.com


On Wednesday, February 20, 2013 5:08:27 PM UTC-8, LenR wrote:
CaSe SenSitiVe?  RedHat vs. redhat? 



Puppet's == operator is case-insensitive. http://docs.puppetlabs.com/puppet/3/reference/lang_expressions.html#equality

If it's a case issue, it's a horrible compatibility-breaking bug. 

Len Rugen

unread,
Feb 20, 2013, 8:33:37 PM2/20/13
to Puppet Users
I wasn't sure, too many different languages....  I guess for a test you could code it == RedHat, but we have a lot of RHEL 6 and I suspect would have hit this somewhere. 


--

Aaron Grewell

unread,
Feb 20, 2013, 9:11:20 PM2/20/13
to puppet-users

It's not that simple.  Puppet thinks osfamily is 'Linux' whereas facter returns 'RedHat' at the command prompt.

jcbollinger

unread,
Feb 21, 2013, 11:57:28 AM2/21/13
to puppet...@googlegroups.com


On Wednesday, February 20, 2013 8:11:20 PM UTC-6, Aaron Grewell wrote:

It's not that simple.  Puppet thinks osfamily is 'Linux' whereas facter returns 'RedHat' at the command prompt.



I can only assume, then, that the facter you are running from the command line is not the same (or same-configured) facter that the agent is running.  Perhaps it is using different libdirs in the two cases, or maybe you have two completely separate Facters on the system.


John

Aaron Grewell

unread,
Feb 21, 2013, 12:08:18 PM2/21/13
to puppet-users
I've checked, but there's only one set of RPMs installed and the facter binary points to those.

# rpm -qa | grep puppet
pe-puppet-enterprise-release-2.0.3-0.pe.el6.noarch
pe-puppet-2.7.9-3.pe.el6.noarch
pe-rubygem-puppet-module-0.3.4-2.pe.el6.noarch

rpm -qa | grep facter
pe-facter-1.6.4-2.pe.el6.noarch

# which facter
/usr/local/bin/facter

# which puppet
/usr/local/bin/puppet


There's nothing installed from tarball or gem, this is a newly built box with just our standard RPM setup on it.


jcbollinger

unread,
Feb 21, 2013, 1:10:38 PM2/21/13
to puppet...@googlegroups.com


On Thursday, February 21, 2013 11:08:18 AM UTC-6, Aaron Grewell wrote:
I've checked, but there's only one set of RPMs installed and the facter binary points to those.

# rpm -qa | grep puppet
pe-puppet-enterprise-release-2.0.3-0.pe.el6.noarch
pe-puppet-2.7.9-3.pe.el6.noarch
pe-rubygem-puppet-module-0.3.4-2.pe.el6.noarch

rpm -qa | grep facter
pe-facter-1.6.4-2.pe.el6.noarch

# which facter
/usr/local/bin/facter

# which puppet
/usr/local/bin/puppet


There's nothing installed from tarball or gem, this is a newly built box with just our standard RPM setup on it.


And I suppose "rpm -q -f /usr/local/bin/facter" tells you "pe-facter-1.6.4-2.pe.el6.noarch"?

And "find / -name 'facter.rb'" doesn't turn up any duplicates?

Since Puppet and / or Facter are behaving abnormally, it is not safe to assume anything about the state of the box, particularly with regard to those components.  Especially so if the Puppet and Facter RPMs you are using are part of your "standard RPM setup", such that you know they work correctly on others of your systems.

You could consider installing custom facts with which to probe Facter's own operating environment in the two cases.

You should also snoop the agent's catalog requests to compare the facts it sends with the ones command-line Facter reports.  I think it's likely that the problem is on the agent end, but this way you can verify that its not the master somehow mixing things up.


John

Aaron Grewell

unread,
Feb 21, 2013, 1:23:58 PM2/21/13
to puppet-users
Argh, never mind.  It's a garden variety client-server version mismatch.  I must've grabbed the wrong version when building the image.
Reply all
Reply to author
Forward
0 new messages