On 2015-30-11 16:09, jcbollinger wrote:
On Sunday, November 29, 2015 at 10:09:20 PM UTC-6, François Lafont wrote: Hi, I'm using Puppet 4 and I'm wondering if this (see below) is possible. I have 2 Puppet modules, moda and modb. We can imagine that theses modules have just one class init.pp. "init.pp" is the name of a manifest file, not of a class. Moreover, although it's poor form, such a manifest could contain definitions for more than one class. Moreover, in The class ::moda has a parameter "param" with the default value defined in the code of "./moda/functions/data.pp". "./moda/functions/data.pp" appears to be the name of another manifest file. I suppose it's instead supposed to be a Ruby (.rb) file defining a custom function, and although I can speculate based on its name what it might do, the details matter, and you have not provided them.
In Puppet 4.x you can have functions written in the Puppet Language. Those reside under <module>/functions/<name>.pp
The data.pp is thus for a function called data. Such a function can be used to provide data for a module - it is supposed to return a hash of key => value mapping.
In addition to writing the function, a module can opt in to using this data functions by adding a configuration in its module metadata.
This is all part of the 4.x data in modules / lookup feature. In Puppet 4.3.0 we also added the ability to use hiera data in modules. - henrik -- Visit my Blog "Puppet on the Edge" http://puppet-on-the-edge.blogspot.se/ -- 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 puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/565C91A9.2010106%40cloudsmith.com. For more options, visit https://groups.google.com/d/optout.