On Wednesday, September 3, 2014 11:32:54 AM UTC-5, Khoury wrote:
>
> Sorry for the delay Felix. Here's a specific example of a situation where 
> the fact might return what I would consider useless information and I would 
> want to revert back to a the value set previously:
>
> On OS X you can have an active user that is at the console and owns 
> /dev/console. If you want to gather that information it's fairly 
> straightforward. But under certain circumstances the owner of the console 
> is root. In that scenario I'd still want the data set on the fact prior to 
> that to persist. My thinking is that I can just validate the data returned 
> (within the plugin itself) and if it doesn't meet my criteria, I can set 
> the fact to itself using Facter.value(console_user).
>
>

As long as you intend to perform the validation inside the fact 
implementation, the fact can keep and use its own cache somewhere on the 
system.

Alternatively, the master stores the most recent set of facts provided by 
each node, and it can be accessed via the REST API 
<https://docs.puppetlabs.com/guides/rest_api.html#facts>.  You could 
conceivably use that as a fact cache.

Overall, however, it is probably a poor idea to compute or rely on node 
facts that reflect the dynamic state of the system, as opposed to its 
(semi-) stable configuration.


John

 

>
> On Fri, Aug 29, 2014 at 9:04 AM, Felix Frank <[email protected] 
> <javascript:>> wrote:
>
>> On 08/28/2014 11:01 PM, Khoury Brazil wrote:
>> > I currently have it written to reuse the data using Facter.value() after
>> > validation but wanted to make sure there wasn't something standardized
>> > that I missed.
>>
>> Can you provide an example of that? I don't really see what you did there.
>>
>> --
>> 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] <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/puppet-users/5400A4A4.5020406%40alumni.tu-berlin.de
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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/7eea2790-537d-45c6-8ee5-d6eb6588e895%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to