Custom functions
Use the Puppet language, or the Ruby API to create custom functions.
For built-in Puppet functions, see the Functions reference.
-
Custom functions overview
Puppet includes many built-in functions, and more are available in modules on the Forge. You can also write your own custom functions. -
Writing custom functions in the Puppet language
You can write simple custom functions in the Puppet language, to transform data and construct values. A function can optionally take one or more parameters as arguments. A function returns a calculated value from its final expression. -
Writing custom functions in Ruby
You can write powerful and flexible functions using Ruby. -
Deferring a function
Deferring a function allows you to run code on the agent during a Puppet run.