Type: New Feature
Affects Version/s: None
Fix Version/s: None
I use puppet 4 and data binding with much satisfaction. Just for memory, data binding for instance it's:
1. A manifest foo/manifests/init.pp like that in a foo module:
2. This boilerplate function foo/lib/puppet/bindings/foo/default.rb:
3. And a puppet function in foo/functions/data.pp:
And now, in hiera, I can override the default value of a parameter like that:
It's very useful but the merge behavior in the data binding mechanism is not changeable and it's necessarily the first behavior, ie the behavior where there is no merge (the first value found wins).
It could be amazing if it was possible to set the merge behavior like in the lookup() function. I have no idea how the syntax could be but the first way I see is something like that in the declaration of the foo class:
The syntax will be
where <merge behavior> will be a string like in the lookup() function, ie 'first', 'unique', 'hash' or 'deep' (cf here) etc. To keep compatibility with the "old" syntax:
will be equivalent to:
I have absolutely no idea if the implementation of this feature will be possible and/or complicated (I'm unable to evaluate that and unable to implement that... unfortunately) but it seems to me that it could be a very useful feature and I'm ready to test an implementation of that when you want of course.
Of course, it's just a wish. No problem if this ticket is rejected.
PS: message edited (to just fix typo)