Use the Puppet language, or the Ruby API to create custom functions. 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 languageYou 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 RubyYou can write powerful and flexible functions using Ruby.Deferring a functionDeferring a function allows you to run code on the agent during a Puppet run.