At this point the only way to do that would be by modifying the  
internals of the system a bit more than is supported.  You could just  
have a single function call in the site.pp file, outside of any node/ 
class, and it could set/retrieve the cached value.  That should be  
trivial.

On Oct 12, 2009, at 2:17 AM, Sunil_mlec wrote:

>
> Yeah, the function call is what I wanted to avoid.
> So, Is there any other way by which we can get the $myvar (as per
> above example) to be available to different puppet clients (without
> using memcache)?
>
> Thanks for your patience.
>
> On Oct 12, 1:58 pm, Ohad Levy <[email protected]> wrote:
>> No, you would always need to call the function.
>>
>>
>>
>> On Mon, Oct 12, 2009 at 4:45 PM, Sunil_mlec <[email protected]>  
>> wrote:
>>
>>> In the case of $myvar = myfunction(), will the value in $myvar be
>>> available to another client without calling myfunction()?
>>
>>> Thanks,
>>> Sunil.
>>
>>> On Oct 12, 11:25 am, Ohad Levy <[email protected]> wrote:
>>>> Sunil, You can store it where ever you like :)
>>
>>>> do you mean inside a puppet variable? or just in memory?
>>>> if you mean for puppet variable,  your function value should be  
>>>> stored
>>> some
>>>> where - e.g.
>>
>>>> $myvar = myfunction()
>>
>>>> than $myvar would contain the value of your function.
>>
>>>> if you mean that you want to store it in memory some where, I  
>>>> would guess
>>>> your best using something like memcache for this job.
>>
>>>> cheers,
>>>> Ohad
>>
>>>> On Mon, Oct 12, 2009 at 2:17 PM, Sunil_mlec <[email protected]>  
>>>> wrote:
>>
>>>>> Thanks Ohad.  You have done me a great favour.
>>>>> I have one more question.  Instead of storing the result in a  
>>>>> local
>>>>> file, can we use some variable (a hash or an array) to store the
>>>>> results.
>>
>>>>> Thanks,
>>>>> Sunil.
>>
>>>>> On Oct 11, 3:07 pm, Ohad Levy <[email protected]> wrote:
>>>>>> here you go:http://gist.github.com/207576
>>
>>>>>> Ohad
>>
>>>>>> On Sun, Oct 11, 2009 at 12:06 AM, Sunil_mlec  
>>>>>> <[email protected]>
>>>>> wrote:
>>
>>>>>>> Hi,
>>>>>>> I m trying to cache some data which will be generated  
>>>>>>> dynamically
>>> by
>>>>>>> the puppetmaster.  Basically, the data will be generated by the
>>>>>>> puppetmaster based on a client query.  Further if the same query
>>> comes
>>>>>>> from a different puppet client, then the cached result should be
>>>>>>> returned.  But, till now I am not going in the right direction.
>>>  Any
>>>>>>> example, would be doing a great favor to me.  Could you please  
>>>>>>> help
>>> me
>>>>>>> here?
>>
>>>>>>> Thanks in advance.- Hide quoted text -
>>
>>>>>> - Show quoted text -- Hide quoted text -
>>
>>>> - Show quoted text -- Hide quoted text -
>>
>> - Show quoted text -
> >


-- 
America believes in education: the average professor earns more money
in a year than a professional athlete earns in a whole week.
     -- Evan Esar
---------------------------------------------------------------------
Luke Kanies | http://reductivelabs.com | http://madstop.com


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to