I am not sure if you can lookup a subkey like that in hiera. (i could be
wrong)
But this is how i do something similar.
I do a hiera lookup for the hash in the class
$mount_points=hiera('talend::exec_mount_points')
Then i pull out all the keys
$mount_points_keys = keys($mount_points)
Then using the keys you can lookup subkeys in the hash
$creds_file_1=$mount_points[$mount_points_keys][creds_file]
Thanks
On Wednesday, April 27, 2016 at 8:47:20 AM UTC-4, Manoj Kumar wrote:
>
> Hi All,
>
> Can you guys please help me to get the hiera hash subkey value in yaml
> files?
>
> What I have in exec.yaml
>
> talend::*exec_mount_points:*
> dataloading2:
> ad_user : 'user123'
> ad_password: 'test123'
> ad_domain: ''
> creds_file: 'passfile'
> mount_source: '//SOME-IP/data'
> mount_point: '/media'
> mount_options:
> "uid=edmadmin,gid=sftp-only,credentials=%{hiera('talend::creds_base_dir')}/.
> *%{hiera('talend::exec_mount_points::dataloading2::creds_file')}*
> ,defaults,sec=ntlm"
> mount_ensure: 'mounted'
> onboot: true
> fs_type: 'cifs'
>
>
> I need to get the value from the above hash to use in its S*ubkey
> (creds_file) value *like in mount_options:
> *%{hiera('talend::exec_mount_points::dataloading2::creds_file')}*
>
> But I am getting nil/blank value. Can anyone suggest on this please
>
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/170f097d-430f-4b34-a71e-a3c1711aa477%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.