LinuxCommandLibrary

facter

system fact gathering tool for Puppet

TLDR

Show all facts
$ facter
copy
Show specific fact
$ facter [os.family]
copy
Show facts in JSON
$ facter --json
copy
Show facts in YAML
$ facter --yaml
copy
List all fact names
$ facter --list
copy
Show timing information
$ facter --timing
copy
Debug output
$ facter --debug
copy

SYNOPSIS

facter [options] [fact...]

DESCRIPTION

facter collects and displays system facts - information about the operating system, hardware, network, and other system properties. It's a core component of Puppet, providing data for configuration management.
Facts include OS details, IP addresses, memory, processors, disk space, and more. Custom facts can be written in Ruby or as executable external facts.

PARAMETERS

--json

Output in JSON format.
--yaml
Output in YAML format.
--list
List all fact names.
--timing
Show timing for each fact.
--debug
Debug output.
--no-custom-facts
Disable custom facts.
--external-dir dir
Directory for external facts.
--puppet
Load Puppet's settings.
-p
Include Puppet facts.

CONFIGURATION

/etc/facter/facts.d/

Custom external facts directory for system-wide facts.
/opt/puppetlabs/facter/facts.d/
Puppet-specific custom facts directory.
~/.facter/facts.d/
User-specific custom facts directory.

COMMON FACTS

$ facter os.name           # Operating system
facter os.release.full   # OS version
facter networking.ip     # IP address
facter memory.total      # Total memory
facter processors.count  # CPU count
facter virtual           # Virtualization
copy

CAVEATS

Some facts require root privileges. Custom facts may slow collection. Facts may differ between facter versions. Puppet-specific facts need --puppet flag.

HISTORY

Facter was created by Luke Kanies as part of the Puppet project at Puppet Labs (now Puppet) in the mid-2000s. Facter 3, a rewrite in C++ (later Ruby again), was released in 2015 for improved performance.

SEE ALSO

puppet(8), ohai(1), ansible(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard