From aa7d6233c3b2886974e5ea4c1ab3aa6decbf0878 Mon Sep 17 00:00:00 2001 From: Konrad Bucheli Date: Mon, 26 Aug 2024 06:40:13 +0200 Subject: [PATCH] document how to deal with Hiera variable interpolation --- admin-guide/puppet/hiera.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/admin-guide/puppet/hiera.md b/admin-guide/puppet/hiera.md index b0c26cad..e4455f07 100644 --- a/admin-guide/puppet/hiera.md +++ b/admin-guide/puppet/hiera.md @@ -125,3 +125,12 @@ block: > ``` and place either the string or the block at the required place in your Hiera YAML. + +# Hiera Variable Interpolation + +Within Hiera also variable interpolation might be use to include other Hiera keys or facts, etc. into the values. +For details check out the [Puppet documentation](https://www.puppet.com/docs/puppet/7/hiera_merging.html#interpolation_functions) + +As such an interpolation starts with `%{`, some key or file content (especially in Apache configuration) might be interpreted as variable interpolation and result in some part of the text disappear. +Or it might simply the puppet run with `Syntax error in string` if Puppet fails to parse what it considers an interpolation. +To escape a `%` you can write `%{literal('%')}` instead.