Share data between invocations of custom function?
I have a custom function on a Puppet 3.8.5 master that reads a YAML file and returns some value. On the first invocation, the contents of the file are read into a class variable (
@@variable) and subsequent invocations use that value unless the file has changed.
This concept works nicely, but feels unsupported. Is there a documented way/best practice to share data between invocations of a custom function? Are there separate patterns for sharing data for the lifetime of the catalog run for one node vs. the lifetime of the puppetmaster?