On Sunday, January 3, 2016 at 11:35:16 PM UTC-6, Francois Lafont wrote:
> Is this pattern "correct"? After thinking, it seems to me a good way to > handle data dependency between modules > Your revised idea appears workable. It establishes class moda::params as a shared data source, along the lines I suggested. It allows module moda to be customized, via class moda::params, and if parameters for modb are not otherwise specified then modb will draw parameter values from those that would be used by moda if it were declared, whether moda actually is declared or not. I do have a couple of observations for you to consider, however: 1. Your use of the 'require' function suggests that you may not understand its distinction from 'include', as that distinction has no significance whatever in this particular case. 'require' differs only in placing *order-of-application* constraints, but the params class contains nothing to apply. 2. It is unclear why you want to use a data function instead of class parameter defaults in module modb. The result is not, technically, a default value, though it is a reasonable facsimile. Nevertheless, the nature of the relationship between the two modules would be clearer if you used straight-up resource defaults and the standard params class pattern. That that would involve cross-module class inheritance, is moot -- hiding the close inter-module coupling inside a data function is not inherently better than having it obvious in class declarations. John -- 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/99adc352-fbae-4512-bce0-06f91be66030%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.