This was something I really wanted to address but did not have a good solution for at the time. The main issue was that the hiera specified/implemented interpolation syntax/logic blocks innovation in this area - we were not able to find syntax that would be 100% backwards compatible. I always thought it was a shame that hiera interpolation is different in syntax and features compared to puppet string interpolation. I wrote the puppet language hiera backend in my tahu module as a proof of concept of what it would take to support this if done in the most powerful way - i.e. data is puppet language. I had ideas of incorporating that implementation into the existing hiera json/yaml backends by having backend options to toggle the interpolation behavior, either for an entry in hiera.yaml, or as a lookup_option per key. That would enable people to opt in where they need this feature. I.e. that flag would control how the content of a hiera {{%{ }}} part would be interpreted, as current hiera interpolation or as if it was a {{${ } }}part in a puppet language string.
Actual result: {noformat} Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Unable to parse (/etc/puppetlabs/code/environments/production/data/common.yaml): found character '%' that cannot start any token. (Do not use % for indentation) while scanning for the next token at line 72 column 16{noformat} Desired result: The content is rendered from the template.