Quantcast
Channel: Ask Puppet: Puppet DevOps Q&A Community - RSS feed
Viewing all articles
Browse latest Browse all 6104

Automatic lookup for default values in module data doesn't work properly when used in sub-modules.

$
0
0
Hello! I'm facing an issue with automatic lookup and module data. I've followed this [guide](https://docs.puppet.com/puppet/latest/lookup_quick_module.html) to set it up. My puppet server is running version `4.3.1`. Let's assume I have the following hierarchy: * Role `my_role` - simply includes `::module_a` * Module `module_a` - parameterised module, with `"data_provider": "hiera"` line in its metadata.json. This module includes `::module_b`. * Module `module_b` - parameterised module, with `"data_provider": "hiera"` line in its metadata.json. It expects to receive as argument `String $my_param` and has a corresponding value in `module_b::my_param` in local hiera store. `module_a` behaves as expected and is able to load all default values that I've added to its local hiera store. However, when I include `module_b` in `module_a`, and don't specify any parameters, I get the following error: 2016-12-11 09:18:53,682 ERROR [qtp422397815-20949] [puppet-server] Puppet Evaluation Error: Error while evaluating a Function Call, Class[Module_b]: expects a value for parameter 'my_param' If I move the `module_b::my_param` to `module_a` local hiera store Puppet looks it up just fine. Another workaround is to use a `function` data_provider in `module_b`. Also, if I make the inheritance hierarchy flat, i.e. directly include both `::module_a` and `::module_b` in `my_role`, only the module that is evaluated first succeeds to load its defaults, while the other module fails with the same error. So it looks like that hiera configuration in one module is somehow overwritten by the configuration in another. Any thoughts/suggestions/advices will be greatly appreciated. Alex.

Viewing all articles
Browse latest Browse all 6104

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>