stdlib module functions
Modules will be discussed in full in Chapter 8, but the stdlib
module (https://forge.puppet.com/modules/puppetlabs/stdlib) is so widely used that it is worth highlighting some of the functions that are available from the module as virtually every install of Puppet will make them available.
It is important to be aware that the functions in stdlib
allow advanced behaviors that are not always best practice approaches to Puppet code, such as being able to read the contents of a YAML file into a string and using the ensure_package
function, which is used to allow for multiple declarations of a package resource. They can provide useful workarounds in complex situations or when code is managed in multiple teams’ political situations.
Note
Many functions have been made redundant by file type conversion, which was made available in Puppet 5, as well as other new features, but those have been left for compatibility purposes.
Array and strings
The...