Facts and Facter
Facter is Puppet’s system profiler, a set of Ruby libraries that work cross-platform and gather information, known as facts, about clients. This tooling provides the necessary information to evaluate the profile of the client and allows configuration decisions to be made based on the pre-existing state of the host in Puppet code.
Puppet 5 and 6 use Facter 3, while Puppet 7 uses Facter 4. Only a handful of features are available in Facter 4, which will be highlighted, and a small number of facts have changed, but most users will find no difference. These differences can be viewed by running the puppet facts diff
command. In Chapter 8, we will highlight how module testing can ensure code is compatible across different versions.
The output of Facter can be seen by running the facter -p
or puppet facts
command on the command line or VSCode terminal. Running either of these commands without any further options will return all the core facts. The -p
flag ensures...