Facts and Functions
This chapter will cover facts. We will show you how the Facter tool gathers them to show the profile of systems, how to interact with Facter, and how to use them in Puppet code. We will also cover how custom and external facts can be added to the provided core facts, to allow for more user-specific facts to be gathered.
Then, we will cover functions. We will explain what functions do and the three types of functions – statement, prefix, and chained. We will examine a selection of the core provided functions to show you their capabilities. A selection of functions will also be shown from the stdlib
module, where we will explain the module’s approach and uses.
Deferred functions, which were introduced in Puppet 6, will also be covered. Here, we will show you how deferred functions differ from normal functions, how to make a function deferred, and pitfalls to avoid while using deferred functions.
In a nutshell, the following topics will be covered...