Announce: Facter 2.0.1

373 views
Skip to first unread message

Eric Sorenson

unread,
Apr 1, 2014, 7:32:28 PM4/1/14
to puppet-...@googlegroups.com, puppe...@googlegroups.com, puppet...@googlegroups.com
Released April 1, 2014. (RC1: February 28; RC2: March 12; RC3: March 25; RC4: March 28.)

Facter 2.0.1 is the first release in the Facter 2 series.

Headline Features
- Fact values can now be arbitrarily complex data structures instead of simple strings.
- There’s a new API for adding facts, which enables structured facts and allows fact values to be built up across multiple ‘chunks’ of code. (see http://docs.puppetlabs.com/facter/2.0/fact_overview.html for the full details )

Additional Changes
- There are some backwards-incompatible changes to fact resolutions which were queued up for a major semver bump.
- Code that was deprecated in the Facter 1.x series is now gone, both internal code as well as some facts (‘ldapname’, ‘memorytotal’, ‘selinux_mode’)
- Facter no longer supports Ruby 1.8.5.

See the full release notes here: http://docs.puppetlabs.com/facter/2.0/release_notes.html
Get Facter 2 by following the instructions here (but install the Facter package instead of Puppet): http://docs.puppetlabs.com/guides/installation.html


Eric Sorenson - eric.s...@puppetlabs.com - freenode #puppet: eric0
puppet platform // coffee // techno // bicycles

Message has been deleted

Stefan Wiederoder

unread,
Apr 2, 2014, 10:49:59 AM4/2/14
to puppet...@googlegroups.com, puppet-...@googlegroups.com, puppe...@googlegroups.com
we´ve had trouble with the new version too:

[root@zoe ~]# facter
undefined method `kernel' for Facter:Module


result was a downgraded to 1.7.5-1

RHEL6-64 with
ruby: 1.8.7.352
puppet: 3.4.3

Jeff McCune

unread,
Apr 2, 2014, 12:04:48 PM4/2/14
to puppet...@googlegroups.com, puppe...@googlegroups.com, puppet-...@googlegroups.com, puppet...@googlegroups.com
For those that are getting the undefined method errors, could you please run with --debug and --trace and paste the results so we could see a bit more information about where those methods are called from?

Thanks,
-Jeff
-Jeff


--
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/e43da920-62a8-4c79-b039-77a10dca927d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Eric Sorenson

unread,
Apr 2, 2014, 12:07:58 PM4/2/14
to puppet...@googlegroups.com, puppet-...@googlegroups.com, puppe...@googlegroups.com
Hi to both Stefan and DJE - these problems usually come up when there are multiple versions of facter installed, i.e. one via gem and one via RPM/deb. Can you verify this is the case? Run with --trace and do something like 'find / -name facter -type d' (hopefully with some smarter options if you have nfs mounts :) ) to see if there is another library directory that is getting picked up. Thanks!

--eric0

Andreas Ntaflos

unread,
Apr 2, 2014, 5:25:03 PM4/2/14
to puppet...@googlegroups.com
On 2014-04-02 11:02, DjE wrote:
> The issue (-d does not provide more informations) :
> facter -p
> undefined method `puppetversion' for Facter:Module

Something like this can also happen when you have a custom fact (or
function?) that calls the Facter API in a now defunct way. For example,
we had this in a custom fact:

if Facter.puppetversion.to_i >= 3
...

Which had to be replaced with this (works in Facter < 2.0.1, too):

if Facter.value(:puppetversion).to_i >= 3
...

This was kindly pointed out to me and fixed by Dominic Cleal in #puppet.

Andreas

signature.asc

DjE

unread,
Apr 2, 2014, 5:59:22 PM4/2/14
to puppet...@googlegroups.com
Hi Andreas,

Thx for your answer, it was indeed a loaded custom fact (-p) i have
fixed with this new syntax and everything works like a charm !

Dje

DjE

unread,
Apr 2, 2014, 6:11:43 PM4/2/14
to puppet...@googlegroups.com
Hi Eric,

Andreas give me the right way ! thx for your answer, i keep the --trace in my mind, it would allowed me to fix it by myself !

Dje
--
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.

Chris Handy

unread,
Apr 4, 2014, 12:35:06 PM4/4/14
to puppet...@googlegroups.com, puppet-...@googlegroups.com, puppe...@googlegroups.com
I am really looking forward to the complex data structures.  I was wondering how this will work with hiera going forward, specifically with the hiera.yaml hierarchy?  Lets say that my hierarchy uses "role" and "app" facts to determine which level of the hierarchy to invoke.  Would I be able to use an array of "apps" and have it match somehow?  I could also see how this would allow multiple "roles" to be defined as a fact and invoked as well.

Eric Sorenson

unread,
Apr 14, 2014, 2:12:50 PM4/14/14
to puppet...@googlegroups.com
On Apr 4, 2014, at 9:35 AM, Chris Handy <chris...@gmail.com> wrote:

> I am really looking forward to the complex data structures. I was wondering how this will work with hiera going forward, specifically with the hiera.yaml hierarchy? Lets say that my hierarchy uses "role" and "app" facts to determine which level of the hierarchy to invoke. Would I be able to use an array of "apps" and have it match somehow? I could also see how this would allow multiple "roles" to be defined as a fact and invoked as well.

Hi Chris, there’s a related feature for an upcoming release of hiera to add support for looking up keys in nested data structures. I’m in airplane mode at the moment so I can’t look up the JIRA ticket but it’s slated for hiera 1.4.0, the next feature release, and should be out in the next couple of months.

Kylo Ginsberg

unread,
Jul 31, 2014, 4:05:33 PM7/31/14
to puppe...@googlegroups.com, puppet...@googlegroups.com
Hi Madd,

On Thu, Jul 31, 2014 at 5:08 AM, Madd Sauer <madd...@googlemail.com> wrote:
[root@devel69 facts.d]# cat /var/lib/puppet/lib/facter/kis_horcm.rb
if Facter.kernel == "Linux"
    Facter.add("kis_horcm") do
        setcode do
            File.exist?("/etc/horcm.conf")
       end
    end
end



One other idea: try changing Facter.kernel to Facter.value(:kernel). The former syntax was deprecated, and the latter works with older facter versions as well.

Kylo
--
Kylo Ginsberg

Join us at PuppetConf 2014September 20-24 in San Francisco
Register by July 31st to take advantage of the Early Bird discount save $249!
Reply all
Reply to author
Forward
0 new messages