| Seems far better to normalize the facts values. An open ended solution would be to make the interpolation syntax of values in hiera.yaml be able to describe arbitrary function calls (to puppet functions) thereby making it possible to transform values used in paths. This would cater to other requests as well were users need to process values in other ways. This is somewhat difficult though due to the syntax of hiera interpolations so it can be hard to find suitable operators without causing breaking changes. An alternative discussed in the past was to allow one or more function calls to be listed in the hiera.yaml under a new top level key - each entry would name a (new) variable and the returned value of the function call would be the value. Those variables would be local to hiera.yaml. For example:
derived_variables: |
normalized: |
my_facts_normalizer
|
And a normalized value could then be interpolated with something like (assuming normalized is a hash of all normalized facts of interest):
"somewhere/% {normalized.foo_fact} /x.yaml" |