On 2018-08-31 18:28, R.I.Pienaar wrote:


On Fri, 31 Aug 2018, at 17:41, Chadwick Banning wrote:
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?


The function can do whatever it wants but needs to return a value and that 
value has to be used by a resource and not mixed in with some other strings 
etc. In my example deferred as the entire value to a resource property is good, 
deferred and then any derived data from it wont work.

You cant for example, as far as I understand it, have the function lookup a 
piece of data and then use that data in a template via template() and epp().  
Those are processed entirely on the master.

You can have nested Deferred values, they are resolved as you expect.

Have not tried, but I think inline templates would work so you get template rendering on the agent side.

- henrik



On Fri, Aug 31, 2018 at 9:12 AM R.I.Pienaar <r...@devco.net> wrote:



On Fri, 31 Aug 2018, at 15:03, Chadwick Banning wrote:
Would it be safe to consider this in a general context i.e. as enabling
agent-side function execution?

I dont think so - for general function calls to be usable you want to get
the value and then do some conditional logic on it.  or put it in a
variable and use it in another resource etc.

That is not what this is for, this is a based placeholder to later be
replaced by the value - you cannot do any conditionals etc with it.

Imagine something like:

mysql::user{"bob":
   password => Deferred(vault_lookup, "bob_pass")
}

(I am just making this syntax up, this is presumably not how it will look)

Here its fine because its a simple interpolation into a value, you cant do
more complex things with this design.

Anyway thats my understanding, Henrik might chime in too

--
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+unsubscr...@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.



--
Chadwick Banning

--
You received this message because you are subscribed to the Google
Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/CAPwwW9GmasAV7Yz98Nq4YawYoehCuxK_JpH5iTj7sAKMRXeHXw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.




--

Visit my Blog "Puppet on the Edge"
http://puppet-on-the-edge.blogspot.se/

--
You received this message because you are subscribed to the Google Groups "Puppet 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/pmbto1%24556%241%40blaine.gmane.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to