On Sun, Nov 21, 2010 at 7:55 AM, Nick <oinksoc...@letterboxes.org> wrote:
> Hi,
>
> A problem I've run into during my first attempts at writing manifests, is
> knowing what possible facts are available, and for a given fact, what values 
> my
> manifest might encounter.
>
> A classic one is the possible values of $operatingsystem, but it applies to 
> all
> sorts of facts.
>
> Of course, I know that not all facts can be enumerated, but I had expected 
> there
> be a catalog of common facts and their values somewhere, but there seems not 
> to
> be.  The Facter page [1] and API documentation [2] give rather scanty
> information about anything, yet alone list any values.  Ultimately I've been
> forced to search out the source code and infer the values from that.
>
> Then there is the question of how consistent the list of facts and their 
> values
> are from version to version of Puppet/Facter. That is even harder to discover
> from the source code.
>
> How do other people tackle this problem?
>

It is straightforward to get a complete list of facter values in your
environment. Here's a ruby script that collects all facts gathered in
puppet master /var/lib/puppet/yaml/facts directory and provide a
summarized view: http://pastie.org/1317925.

fact:
{"value"=>"# of system reporting value"...}

Sample output:
facterversion:
{"1.5.7"=>5, "1.5.1"=>10, "1.3.5"=>1}
...
lsbdistid:
{"Debian"=>6}
lsbdistrelease:
{"testing/unstable"=>2, "testing"=>3, "5.0.3"=>1}
...
operatingsystem:
{"Debian"=>11, "CentOS"=>5}
...

It's not pretty, but should give you all values in your environment.
If the # of systems doesn't add up, then it's a fact that's not
present on some systems. In the example above there was 16 servers,
but lsb* only have 6 server reporting, because lsb_release wasn't
install on all systems.

Thanks,

Nan

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to