I have written following template in my chef cookbook recipe
template '/etc/app.conf' do
variables({
my_id: Chef::HTTP.new(https://example.com).get('/',{header})
})
end
And my erb file is
Output is : <%= @my_id %>
I actually want to perform some ruby operations(mainly filter out and count the components of my_id) and then pass those values(count of each component) back to the template and use it further. What should be erb configuration or anything thats need to be added in template block?
(Here, my_id actually has the subnets and I want to get those the count of those subnets and its values so that I can use it further to perform another http request and get the nodes in each of the subnet).