Feature #1932

Facts should support a ttl

Added by Luke Kanies about 3 years ago. Updated 3 months ago.

Status:Duplicate Start date:02/05/2009
Priority:High Due date:
Assignee:- % Done:

0%

Category:library
Target version:-
Keywords:ttl caching Affected Facter version:
Branch:
Votes: 2

Description

When defining facts, you should be able to declare a TTL for the fact value. Some facts need to be refreshed constantly, and some should never be refreshed.


Related issues

related to Facter - Feature #4519: Facter should provide a convenient way to cache values Accepted 08/11/2010

History

Updated by James Turnbull over 2 years ago

  • Category set to library
  • Priority changed from Normal to High

Updated by Adrien Thebo 9 months ago

  • Assignee set to Adrien Thebo
  • Branch set to https://github.com/adrienthebo/facter/tree/tickets/next/1932

I have some preliminary work for this at the given branch. As it stands, there was fact-wide caching of all facts that was permanent, which would guarantee that all facts would be static. This does not seem like desired behavior.

In place of this, I’ve removed the fact-wide caching and added a has_ttl method to the Facter::Util::Resolution class, so we can have per-resolution granularity of facts. I would greatly appreciate feedback from this, and I’ll send this to the mailing list shortly.

Lastly, what strikes me is that we may want caching of facter values between runs. For very costly facts that are more or less static, it could prove beneficial to serialize facts and cache them in /var/lib/puppet, /var/lib/facter, or some other location, depending on the user, and reuse them between runs.

Updated by Michael Stahnke 8 months ago

  • Target version changed from 1.6.0 to 1.6.x

Updated by Adrien Thebo 8 months ago

  • Assignee deleted (Adrien Thebo)
  • Branch deleted (https://github.com/adrienthebo/facter/tree/tickets/next/1932)

Updated by Ken Barber 5 months ago

  • Status changed from Accepted to Duplicate

Duplicating this one as this was added during #2157.

Updated by Ken Barber 3 months ago

  • Target version deleted (1.6.x)

Also available in: Atom PDF