Ask Your Question

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

asked 2016-12-11 09:04:53 -0600

Alex.G gravatar image


I'm facing an issue with automatic lookup and module data. I've followed this guide 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.


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-12-12 02:09:28 -0600

Alex.G gravatar image

Upgrade to v4.8.1 just solved the issue.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2016-12-11 08:50:57 -0600

Seen: 143 times

Last updated: Dec 12 '16