Reader small image

You're reading from  Puppet 8 for DevOps Engineers

Product typeBook
Published inJun 2023
PublisherPackt
ISBN-139781803231709
Edition1st Edition
Tools
Concepts
Right arrow
Author (1)
David Sandilands
David Sandilands
author image
David Sandilands

David Sandilands is a principal solutions architect at Puppet, with a focus on the product management of Puppet's development ecosystem and integrations. This includes management of the Forge, supported modules, the Puppet Developer Kit, and integrations such as ServiceNow and Splunk. Before this, David worked within Puppet's solutions architect team, helping Puppet's largest customers deliver infrastructure automation at scale, and supported these customers in their DevOps working practices. He spent eight years at NatWest as a cloud infrastructure engineer delivering their IaaS platform. Based in Falkirk, Scotland, David has a Bachelor of Engineering in computer science from the University of Edinburgh.
Read more about David Sandilands

Right arrow

Deferred functions

A Deferred function (also known as an agent side function) is a function with the Deferred type applied to it. This causes the function to run locally on a client when the catalog is applied, rather than on a Puppet server during compilation. The catalog for a deferred function contains what to run on the client rather than the output of the function. The deferred type was introduced in Puppet 6.0 and is available in all later versions.

This is typically used when the compilation server can’t access a necessary source in a function – for example, when retrieving a secret from a HashiCorp Vault server, where security is set up to only allow the client to access a secret.

The syntax for applying Deferred is as follows:

Deferred( name of function, [arguments])

The following is an example of retrieving a secret from vault. This can be used within a user resource for exampleapp to set the password from a Vault path of exampleapp/password:

...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Puppet 8 for DevOps Engineers
Published in: Jun 2023Publisher: PacktISBN-13: 9781803231709

Author (1)

author image
David Sandilands

David Sandilands is a principal solutions architect at Puppet, with a focus on the product management of Puppet's development ecosystem and integrations. This includes management of the Forge, supported modules, the Puppet Developer Kit, and integrations such as ServiceNow and Splunk. Before this, David worked within Puppet's solutions architect team, helping Puppet's largest customers deliver infrastructure automation at scale, and supported these customers in their DevOps working practices. He spent eight years at NatWest as a cloud infrastructure engineer delivering their IaaS platform. Based in Falkirk, Scotland, David has a Bachelor of Engineering in computer science from the University of Edinburgh.
Read more about David Sandilands