Hi all,
We wanted to let you know about an upcoming capability, the Deferred type, that is now present in Puppet 6 nightlies and will be part of the Puppet 6.0 release.
A longstanding request has been to allow agents to fetch data for themselves at catalog application time. One key use case for this is getting secrets directly from a store like Conjur, Vault or Consul. Without this capability the master has to be in the middle and secret values are passed in catalogs around more than is necessary.
The solution in Puppet 6 is the Deferred type. A Deferred value describes a function call to be made in the future and when placing it in a catalog the agent will replace it with the result of calling the wrapped function before it continues with application as normal.
Of course, for the agent to actually fetch data from a keystore the function has to exist on the agent side and be loaded during a run. In Puppet 6.0, these functions will be downloaded from the master via pluginsync from the lib/puppet/functions directory in modules, then loaded during an agent run. Though Deferred is intended primarily for agents running with a master, it does work in the same way with an agent only.
https://gist.github.com/turbodog/06d3fecef403bfefd9c8174ede4d9174 has more explanation and walks you through a simple Deferred function example. Work on this is tracked in PUP-8711 and updating the Puppet specification for Deferred is a work in progress happening here: https://github.com/puppetlabs/puppet-specifications/pull/122
If you have other use cases for Deferred we’d love to hear what those are.
Lindsey
Lindsy,Is it just ment for this use case? I can think of other situations where in might be vary valuable to fetch a value at run-time on the agent. Now whenever we have to get the current state, we need to make a fact. If we can make deferred functions for that that would make things much more simple. I'm not sure if it the still is "The Puppet way". Like to hear any thoughts on that.
--
You received this message because you are subscribed to a topic in the Google Groups "Puppet Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/puppet-users/DurqiLnVWMk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/1535721137.3301091.1492516568.3EB7087A%40webmail.messagingengine.com.
For more options, visit https://groups.google.com/d/optout.
So for this example, there are some sort of limitations as to what the 'vault_lookup' function is able to do internally? I had just assumed that as long as the function returned a simple value, what the function does internally was open.As an example, could Deferred be used to read and extract a value from a file agent-side?
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/pmbugj%2437k%241%40blaine.gmane.org.