hash lookup in template using scope function
Hi, I want am using following code for hiera lookup which is working fine.
YAML --- appname: 'tomcat' Template --- appname: <%= scope().call_function('hiera',['appname'])%>
But, now I have values in YAML in hash format and I want to do lookup using $hostname.appname (where hostname should be facter and appname is sub key) e.g.
YAML --- agentnode1: appname: 'tomcat' approle: 'webserver' Template --- approle: <%= scope().call_function('hiera',['@hostname.approle'])%>
Above lookup is not working as @hostname facter is not getting resolved in this lookup. Also, I tried escaping the quotes but no use. Any ideas?