I have a custom function that I need to call (server-side) from at least two different puppet modules. The calls are to be made in Puppet DSL defined types, not Ruby-based custom types and providers.
I know that if I put the definition in a .rb file in the "lib\puppet\parser\functions" directory it is accessible in that module. Can that function be called from other modules, perhaps with some module qualifier before it? Or do I need to use some other approach? The function accepts two string arguments and returns a hash.
The little that I know about custom functions is found here:
https://docs.puppetlabs.com/guides/custom_functions.html
https://docs.puppetlabs.com/guides/plugins_in_modules.html
The following blog post seems to suggest that all functions from all modules are accessible from any module, but I may be misunderstanding it:
http://www.masterzen.fr/2011/10/29/puppet-extension-points-part-1/
pluginsyncis enabled, your function should be available to any other manifest. - ptiernopluginsyncis relevant for the agent only. It is unrelated to parser functions. It will sync them to the agent, but manifests can be compiled regardless of that, even whenpluginsyncis disabled (don't do that, though). - Felix Frank$libdiron the master. Probably should have been more specific. - ptierno