The Puppet functions

Functions are predefined codes of Ruby. For example, the template('modulename/templatename') code we used in the templates example is a function that is calling the template file as content. Most of the functions return a value or modify the catalog. In the next section, we will start with the stdlib functions.

The stdlib functions

There are many ready-made functions in the stdlib module. The complete module name is puppetlabs-stdlib. As the module name implies, the stdlib module has many standard definitions that can be used in different modules. In this section, we will just see some of the function examples and how to use them. You can find the full reference from https://forge.puppetlabs.com/puppetlabs/stdlib. To install ...

Get Learning Puppet for Windows Server now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.