How to access map variable using hiera?
# test.yaml x-certificate: id:'xxxxx' name:'x'
How to access id value of x-certificate using hiera? Is it possible?
From your code you'd have something like:
$xcert = hiera('x-certificate') $id = $xcert['id']
Note that in general it is considered best practice to use the automatic parameter lookup feature of parameterised classes for reading in the data from hiera, rather than making explicit calls to hiera using the hiera function, as I have shown here.
Asked: 2015-12-15 21:56:33 -0500
Seen: 123 times
Last updated: Dec 16 '15