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+unsubscr...@googlegroups.com <mailto:puppet-users+unsubscr...@googlegroups.com>. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/b07f61bd-c023-4627-959c-b0ef0bc704c8%40googlegroups.com <https://groups.google.com/d/msgid/puppet-users/b07f61bd-c023-4627-959c-b0ef0bc704c8%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.


--

Visit my Blog "Puppet on the Edge"
http://puppet-on-the-edge.blogspot.se/

--
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/oirh4v%24a97%241%40blaine.gmane.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to