Summary
In this chapter, you learned how the Facter tool provides system profiling information with its facts and how this can be expanded using external facts and custom facts. We warned you that there is an infrastructure cost to gathering facts and that the scale it will work with should be balanced. We stated that external facts can be simple flat files of static data or executable scripts, as allowed by the operating system. Custom facts, although written in Ruby, were shown to have several advantages over external facts. Being able to confine the custom fact to only run on certain systems allows you to choose different resolutions with a weight as to which should be selected and timeouts at the resolution level in Puppet 7 or the execution level in Puppet 6 and below.
Next, we reviewed functions and highlighted the vast range of tasks functions can do to manipulate the catalog or return calculated values in Puppet code. Here, we discussed catalog statements, which are used...