On Friday, 31 August 2018 16:41:34 UTC+1, 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?
>


In theory, you probably could.  The ruby code probably just executes on the 
Agent.  Personally though if I were to find myself in this situation, I'd 
really think about what I was trying to achieve and why I am in this 
situation in the first place...  Perhaps it's Puppet design that needs to 
be refactored, or if I really wanted to "do" something on an Agent, a 
Custom Type / Provider might be a better vehicle.

I can partially see the argument in proceeding posts for making decisions 
on run time environment data...  I'd argue that if you're writing a 
Deferred Type in Ruby, it's not that much further to write a Fact.  Also, 
unit and acceptance testing code that relies on a run time Fact seems very 
difficult.


On Fri, Aug 31, 2018 at 9:12 AM R.I.Pienaar <[email protected] <javascript:>> 
> 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 
>> [email protected] <javascript:>.
>> 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/106d796d-1850-44de-9040-cad5bc3e1c8b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to