On Thursday, May 16, 2013 6:49:49 AM UTC-5, jdt wrote:
>
> Hello,
>
> I have a yaml file with a hash of network interfaces (ifaces hash), each 
> nic has an associated ipaddress and netmask.
> Using hiera ifaces  fqdn=host.mycompany.com I can get all interfaces back.
> Is there a way using the hiera cli to get a specific value of a key within 
> the hash?
>
> e.g.  hiera  ifaces fqdn=host.mycompany.com
> {"eth0"=>{"ipaddress"=>"10.4.115.48", "netmask"=>"255.255.255.0"}, 
> "eth0:1"=>{"ipaddress"=>"10.4.115.58", "netmask"=>"255.255.255.0"}}
>
>
> Can I with a single hiera command get info of only the interface eth0?
> Or get just the ipaddress of interface eth0?
> Or was hiera not meant for this kind of use?
>
>

You seem to be asking for some kind of XPATH-like feature, but hiera does 
not provide one.  Via its programmatic interface (i.e. in Puppet), you 
would simply take the hash object returned by hiera and access the desired 
element by its key.  If you want to be able to do similar from the command 
line then you probably should write your own Ruby program that does the 
same.


John

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to