iptables::test: ip: 1.1.1.1 : 'adm-1' 2.2.2.2 : 'adm-2' 3.3.3.3 : 'adm-3'
And i want to parse this file ininline_template.
I do:$variable1 = hiera('iptables::test.ip') $variable2 = inline_template("<% @variable1.each do |key,value| %>Allow From <%=key %> #<%=value %>\n<% end -%>")Error 400 on SERVER: Could not find data item iptables::test.ip in any Hiera data file and no default supplied
But get error:
Could you help me how parse my .yaml ininline_template. Thank you.
Hi.I have some .yaml file:iptables::test: ip: 1.1.1.1 : 'adm-1' 2.2.2.2 : 'adm-2' 3.3.3.3 : 'adm-3'
And i want to parse this file ininline_template.
I do:$variable1 = hiera('iptables::test.ip') $variable2 = inline_template("<% @variable1.each do |key,value| %>Allow From <%=key %> #<%=value %>\n<% end -%>")Error 400 on SERVER: Could not find data item iptables::test.ip in any Hiera data file and no default supplied
But get error:
Could you help me how parse my .yaml ininline_template. Thank you.
$variable1 = lookup('iptables::test.ip')
$variable2 = inline_template("<% @variable1.each do |key,value| %>Allow From <%=key %> #<%=value %>\n<% end -%>")$variable1 = lookup('iptables::test')
# or $variable1 = hiera('iptables::test')
$variable2 = inline_template("<% @variable1['ip'].each do |key,value| %>Allow From <%=key %> #<%=value %>\n<% end -%>")