Custom facts
Facts are the most comfortable kind of variables to work with:
They are at top scope, therefore easily accessible in every part of our code
They provide direct and trusted information, being executed on the client
They are computed: their values are set automatically and we don't have to manage them manually.
Out-of-the-box, depending on Facter version and the underlying OS, they give us:
Hardware information (
architecture bios_* board* memory* processor virtual
)Operating system details (
kernel* osfamily operatingsystem* lsb* sp_* selinux ssh* timezone uptime*
)Network configuration (
hostname domain fqdn interfaces ipaddress_* macaddress_* network*
)Disks and filesystems (
blockdevice_* filesystems swap*
)Puppet related software versions (
facterversion puppetversion ruby*
)
We already use some of these facts in modules to manage the right resources to apply for our operating systems, and we already classify nodes according to their hostname.
There's a lot more that we can do with them,...