Centos 7 facter > 2 issue

173 views
Skip to first unread message

Phil Manuel

unread,
Jul 15, 2015, 9:09:35 PM7/15/15
to puppet...@googlegroups.com
Hi,

If I do a clean install of CentOS 7 with facter and puppet, my puppet fails with

puppet agent -t
Info: Retrieving pluginfacts
Info: Retrieving plugin
Error: Could not retrieve local facts: undefined method `hostname' for Facter:Module
Error: Failed to apply catalog: Could not retrieve local facts: undefined method `hostname' for Facter:Module


rpm -qa puppet
puppet-3.8.1-1.el7.noarch
rpm -qa facter
facter-2.4.4-1.el7.x86_64

If i run facter hostname it works fine.  If I run puppet facts find <hostname>
Error: Could not call 'find' on 'facts': undefined method `hostname' for Facter:Module
Error: Could not call 'find' on 'facts': undefined method `hostname' for Facter:Module
Error: Try 'puppet help facts find' for usage


If I downgrade facter to 1.7.x then it works fine.


If I  perform the same process on Fedora 22 which has

rpm -qa facter
facter-2.4.1-1.fc22.x86_64
rpm -qa puppet
puppet-4.1.0-1.fc22.noarch


It works fine.

Has anyone got any suggestions ?

Thanks

Phil.

Peter Huene

unread,
Jul 16, 2015, 2:43:59 AM7/16/15
to puppet...@googlegroups.com
On Wed, Jul 15, 2015 at 4:51 PM, Phil Manuel <fla...@gmail.com> wrote:
Hi,

If I do a clean install of CentOS 7 with facter and puppet, my puppet fails with

puppet agent -t
Info: Retrieving pluginfacts
Info: Retrieving plugin
Error: Could not retrieve local facts: undefined method `hostname' for Facter:Module
Error: Failed to apply catalog: Could not retrieve local facts: undefined method `hostname' for Facter:Module


It sounds like you're using a module with a custom fact that, on CentOS 7 at least, uses a syntax that was removed in Facter 2.x and later. 

Facter 2.x (and Facter 3.x) do not support querying facts via the "method syntax" on the Facter module itself.

e.g. `Facter.hostname` is not supported in 2.x+; instead, use `Facter.value(:hostname)`.

Specify `--trace` to puppet and see if you can determine the offending module in the trace back.
 

rpm -qa puppet
puppet-3.8.1-1.el7.noarch
rpm -qa facter
facter-2.4.4-1.el7.x86_64

If i run facter hostname it works fine.  If I run puppet facts find <hostname>
Error: Could not call 'find' on 'facts': undefined method `hostname' for Facter:Module
Error: Could not call 'find' on 'facts': undefined method `hostname' for Facter:Module
Error: Try 'puppet help facts find' for usage


If I downgrade facter to 1.7.x then it works fine.


If I  perform the same process on Fedora 22 which has

rpm -qa facter
facter-2.4.1-1.fc22.x86_64
rpm -qa puppet
puppet-4.1.0-1.fc22.noarch


It works fine.

Has anyone got any suggestions ?

Thanks

Phil.

--
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/86d2bf02-7152-4a9a-bd25-9645fbaab7d2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Join us at PuppetConf 2015, October 5-9 in Portland, OR - www.2015.puppetconf.com 
Register early to save 40%!
Reply all
Reply to author
Forward
0 new messages