FACTER(8)
π FACTER β okay bestie, let's get you acquainted
so this is the manual page for facter, from the Facter manual, and honestly? it's a banger. let's go π
β¨ NAME β¨
facter β collect and display facts about the current system π¦
πΈ SYNOPSIS πΈ
facter [options] [query] [query] [...]
π DESCRIPTION π
okay so facter is a command-line tool that gathers basic facts about nodes (aka systems, aka the machine you're on rn) β think hardware details, network settings, OS type and version, and more. it's giving full dossier on your computer β¨
these facts get made available as variables in your Puppet manifests, and you can use them to inform conditional expressions in Puppet. iykyk π
if you don't give it any queries? it just returns all the facts. every single one. no cap.
also β a bunch of the command line options can be set via the HOCON config file instead. that same file can also be used to block or cache certain fact groups. versatile queen π
π OPTIONS π
--colorβ turn color output ON π--no-colorβ turn color output OFF π-c,--configβ where the config file lives--custom-dirβ a directory to use for custom facts-d,--debugβ enable debug output--external-dirβ a directory to use for external facts--hoconβ output in Hocon format-j,--jsonβ output in JSON format-l,--log-levelβ set the logging level. the supported levels are:none,trace,debug,info,warn,error, andfatal--no-blockβ disable fact blocking--no-cacheβ disable loading and refreshing facts from the cache--no-custom-factsβ disable custom facts--no-external-factsβ disable external facts--no-rubyβ disable loading Ruby, facts requiring Ruby, and custom facts--traceβ enable backtraces for custom facts--verboseβ enable verbose (info) output--show-legacyβ show legacy facts when querying all facts-y,--yamlβ output in YAML format--strictβ enable more aggressive error reporting π-t,--timingβ show how much time it took to resolve each fact β±οΈ--sequentialβ resolve facts sequentially--http-debugβ whether to write HTTP request and responses to stderr
π¨ bestie listen. --http-debug should never be used in production. like, never ever. periodt.
-p,--puppetβ load the Puppet libraries, which lets Facter load Puppet-specific facts--version,-vβ print the version--list-block-groupsβ list block groups--list-cache-groupsβ list cache groups--help,-hβ help for all arguments π«Ά
π FILES π
/etc/facter/facter.conf
a HOCON config file, and she does a LOT: specify directories for custom and external facts, set various command line options, and specify facts to block. see the example below for details, or visit the GitHub README:
https://github.com/puppetlabs/puppetlabs-hocon#overview
π EXAMPLES π
display all facts
$ facter
disks => {
sda => {
model => "Virtual disk",
size => "8.00 GiB",
size_bytes => 8589934592,
vendor => "ExampleVendor"
}
}
dmi => {
bios => {
release_date => "06/23/2013",
vendor => "Example Vendor",
version => "6.00"
}
}
[...]
display a single structured fact
$ facter processors
{
count => 2,
isa => "x86_64",
models => [
"Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz",
"Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz"
],
physicalcount => 2
}
display a single fact nested within a structured fact
$ facter processors.isa
x86_64
display a single legacy fact
quick note bestie: non-structured facts that existed in previous versions of Facter are still available, but they are not displayed by default β that's because they're redundant with the newer structured facts. not a bug, just a glow-up π
$ facter processorcount
2
format facts as JSON
$ facter --json os.name os.release.major processors.isa
{
"os.name": "Ubuntu",
"os.release.major": "14.04",
"processors.isa": "x86_64"
}
an example config file
# always loaded (CLI and as Ruby module)
global : {
external-dir : "~/external/facts",
custom-dir : [
"~/custom/facts",
"~/custom/facts/more-facts"
],
no-external-facts : false,
no-custom-facts : false,
no-ruby : false
}
# loaded when running from the command line
cli : {
debug : false,
trace : true,
verbose : false,
log-level : "info"
}
# always loaded, fact-specific configuration
facts : {
# for valid blocklist entries, use --list-block-groups
blocklist : [ "file system", "EC2" ],
# for valid time-to-live entries, use --list-cache-groups
ttls : [ { "timezone" : 30 days } ]
}
and that's the whole page, bestie π«Ά this one's from Puppet, Inc., dated March 2024, and it's page FACTER(8) of the Facter manual. go forth and query some facts, you absolute icon πβ¨
π¦ where this page comes from
- debian trixie: facter 4.10.0-1 Β· Apache-2.0
- ubuntu questing: facter 4.10.0-1
- ubuntu resolute: facter 4.10.0-1build1 Β· Apache-2.0
- ubuntu stonking: facter 4.10.0-1build1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms