Puppet Version: 5.5.14 Puppet Server Version: 5.3.8 OS Name/Version: RHEL 7.x In our Hiera data, we have made use of lookup_options to control the merge behaviour, so in our catch-all common.yaml there are entries such as:
--- |
lookup_options: |
profile::autofs::mounts: |
merge: hash |
This works as desired. However we have some exceptions where we want to override this on a per-role basis back to the original "first" behaviour, so as we have a higher priority role level, I added the following in a role/foo.yaml:
--- |
lookup_options: |
profile::autofs::mounts: |
merge: first |
If I use the "puppet lookup" command against the correct host, this appears to work as desired, using `--explain-options` I get the following result:
Merged result: { |
"profile::autofs::mounts" => { |
"merge" => "first" |
} |
} |
For any other hosts I still get the behaviour defined at the common level:
Merged result: { |
"profile::autofs::mounts" => { |
"merge" => "hash" |
} |
} |
All good. However this doesn't seem to actually apply to the lookup itself:
Using merge options from "lookup_options" hash |
Searching for "profile::autofs::mounts" |
... |
It only ever picks up the behaviour defined at the common level. Desired Behavior: I would expect to see:
Using merge options from "lookup_options" first |
Searching for "profile::autofs::mounts" |
... |
Actual Behavior: One bit of information that might be relevant is that in order for our lookups to work from the CLI, I have to use the --compile option, so basically something like:
puppet lookup --compile --environment <env> --node <node> profile::autofs::mounts --explain(-options) |
We have multiple backends/levels configured in Hiera, a mix of YAML/eYAML and using the HTTP backend too. I noticed there was PUP-7037 which was raised for similar behaviour but was ultimately traced to a typo. I'm confident this isn't down to a typo. |