I'm new to CHEF and I'm starting to learn to read/write recipes. I'm trying to understand the consul recipe (https://github.com/johnbellone/consul-cookbook/blob/master/recipes/default.rb).
I can follow most of the recipe, but the part that has me confused are lines 46-55:
config = consul_config service_name do |r|
node['consul']['config'].each_pair { |k, v| r.send(k, v) }
notifies :reload, "consul_service[#{service_name}]", :delayed
end
install = consul_installation node['consul']['version'] do |r|
if node['consul']['installation']
node['consul']['installation'].each_pair { |k, v| r.send(k, v) }
end
end
Can anyone explain to me what those lines are saying?