Details
-
Bug
-
Status: Accepted
-
Major
-
Resolution: Unresolved
-
None
-
None
Description
When defining multiple levels of hierarchy in hiera.yaml (3 or more), and requesting hiera to lookup a key that is found on at least 3 levels, and lookup options for that key are configured to merge deep with a knockout prefix, the merge fails to knockout the key matching the higher precedence knockout.
Steps to reproduce:
hiera.yaml:
|
version: 5
|
defaults:
|
datadir: data
|
data_hash: yaml_data
|
|
hierarchy:
|
- name: node specific data
|
path: node/%{::site.node}.yaml
|
|
- name: product data
|
path: product/%{::site.product}.yaml
|
|
- name: os data
|
path: os/%{::os.family}.yaml
|
|
- name: global data
|
path: common.yaml
|
|
common.yaml:
|
lookup_options:
|
classes:
|
merge:
|
strategy: deep
|
knockout_prefix: --
|
classes:
|
- profiles::motd
|
- profiles::network
|
|
os/RedHat.yaml:
|
classes:
|
- profiles::yum
|
|
product/product.yaml
|
classes:
|
- profiles::application
|
|
node/node.yaml:
|
classes:
|
- --profiles::network
|
- network
|
Expected
puppet lookup --knock-out-prefix '--' --merge deep classes |
---
|
- profiles::motd
|
- profiles::yum
|
- profiles::application
|
- network
|
Actual
puppet lookup --knock-out-prefix '--' --merge deep classes |
---
|
- profiles::motd
|
- profiles::network
|
- profiles::yum
|
- profiles::application
|
- network
|
Removing a layer from the hierarchy causes the merge to behave as expected. The difference being:
puppet lookup --knock-out-prefix '--' --merge deep classes | grep 'Found key:' | wc -l |
4 |
vs
puppet lookup --knock-out-prefix '--' --merge deep classes | grep 'Found key:' | wc -l |
3 |
Verified Affected Versions
Puppet 4.10.0
Puppet 4.10.9
Puppet 5.3.1
Attachments
Issue Links
- relates to
-
HI-223 Hiera 'deeper' merge knockout only knocks out from closest array
-
- Needs Information
-
-
PUP-7438 Lookup knockout prefix behaviour affected by seemingly unrelated changes in hierarchy
-
- Closed
-
- mentioned in
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...