On 26/06/17 18:33, João Matos wrote:
> Hi
>
> i wanted to had the value to hiera_hash string key from a variable
>
> something like:
>
> $variable= specific
> $newvariable = hiera_hash('data::hiera::$variable')
>
> is this possible what's the correct syntax?
>
I think you want to interpolate a value into the string that is the key
you are looking up. If so, you would do this:
$variable = 'specific'
$newvariable = hiera_hash("data::hiera::${variable}")
Note that if you are on a recent release you want to use the lookup()
function instead of hiera_hash function (and friends hiera, hiera_array,
etc).
Best,
- henrik
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google
> Groups "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to puppet-users...@googlegroups.com
> <mailto:puppet-users+unsub...@googlegroups.com>.