For example, I would like to create a number of template files in a loop like this:
templates = [
"template1",
"template2",
"template3"
]
templates.each do |tmp|
template "/file/path/#{tmp}" do
source "#{tmp}.erb"
mode "0644"
action :create
end
end
However under some circumstances I would also like to use a notify statement on a particular template, like:
notifies :create, "template[/file/path/template2]", :immediately
Because no template resource for template2 is explicitly defined in the cookbook, is that “notifies” statement going to be functional?? Is there way to write the cookbook so that I can use “notifies” statements like that one while still maintaining the conciseness of building templates in a loop??
Thanks!!!