Hiera Data Provider Classic vs Version 4 Interpolation Behavior

asked 2016-09-09 18:08:44 -0600

JoshAcc gravatar image

When a variable cannot be resolved in a configured path for hiera v4 the entire lookup fails and nothing is returned. In Hiera classic, the lookup would continue on using the next defined path.

Example v4 hiera.yaml:

version: 4
datadir: data
- name: "Tier"
backend: yaml
path: "%{undefinedvariable}"

puppet lookup classes --node 'nodeone' --explain --merge unique
No such key: "undefinedvariable"

Is this expected behavior?

My use case is that not all of my nodes in the same environment have identical facts and if a dynamic path contains a variable that cannot be resolved, I would like the lookup to continue and use the paths that contain variables that can be resolved. Basically, continue to function as Hiera classic does.

edit retag flag offensive close merge delete