3

Is there a reference for the facts that are included in a default puppet installation?

For example, some examples I see include $operatingsystem which can be used to identify the distribution. Is there a reference of these somewhere?

4 Answers 4

7

As you probably know, these are all provided by the facter package. By running facter on the cli, you can see all of the facts it knows about:

architecture => i386
domain => <redacted>
facterversion => 1.3.8
fqdn => <redacted>
hardwareisa => unknown
hardwaremodel => i686
hostname => <redacted>
id => <redacted>
ipaddress => <redacted>
ipaddress_eth0 => <redacted>
kernel => Linux
kernelrelease => <redacted>
lsbdistcodename => hardy
lsbdistdescription => Ubuntu 8.04.4 LTS
lsbdistid => Ubuntu
lsbdistrelease => 8.04
macaddress => <redacted>
macaddress_eth0 => <redacted>
memoryfree => 336.51 MB
memorysize => 453.34 MB
operatingsystem => Debian
operatingsystemrelease => <redacted>
processor0 => Intel(R) Xeon(R) CPU           L5335  @ 2.00GHz
processor1 => Intel(R) Xeon(R) CPU           L5335  @ 2.00GHz
processor2 => Intel(R) Xeon(R) CPU           L5335  @ 2.00GHz
processor3 => Intel(R) Xeon(R) CPU           L5335  @ 2.00GHz
processorcount => 4
ps => ps -ef
rubysitedir => /usr/local/lib/site_ruby/1.8
rubyversion => 1.8.6
sshdsakey => <redacted>
sshrsakey => <redacted>
swapfree => 210.98 MB
swapsize => 256.00 MB
uniqueid => <redacted>
3
  • I beat you to it, but its the thought that counts ;-) Jun 16, 2011 at 19:11
  • Heh, thanks Kyle. Good luck with puppet. I'm just starting to cut my teeth with it as well.
    – EEAA
    Jun 16, 2011 at 19:12
  • Ah, good excuse to build up QA on puppet, lets both post our questions :-) Jun 16, 2011 at 19:22
2

Oh just found that the easiest way is just to run facter from the command line. This outputs a list of the key values pairs:

root@ny-man01:/etc/puppet/files# facter
architecture => x86_64
domain => ny.stackoverflow.com
facterversion => 1.5.7
fqdn => ny-man01.ny.stackoverflow.com
hardwareisa => unknown
hardwaremodel => x86_64
hostname => ny-man01
...
...

Source: https://puppet.com/docs/puppet/latest/lang_variables.html

1

For Linux distributions you will also want to make sure you have the LSB Release information package installed. In Red Hat and Fedora distros this package is simply lsb-release

Without this package on Linux, the information provided by facter will be very spartan.

1

Some Facter facts are only available when facter is run as root:

$ diff <(facter) <(sudo facter)
28a29
> manufacturer => Supermicro
48a50
> productname => X8SIE
53a56
> serialnumber => 0123456789
58a62
> type => Sealed-case PC

In many cases, it's the facts that are derived from BIOS inspection with dmidecode and the like that are unable to be run as normal users.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .