I'm trying to figure out how can I construct the path to templates (or files, since it works the same way) folder, then I could read it and use template resource in the loop, so each template file could trigger notification on change.
I can't use remote_directory because I want to notify services only if template changes.
I also would like to avoid manual template specification, since there could be many files inside those dirs. Plus it would allow us to change just configs in the templates folder without touching recipe.
The main problem is those subdirectories like default, host, host-version and the logic chef goes through to determine correct templates folder. I was thinking maybe there is a method in one of the Chef classes I could call from my custom cookbook to get to the starting point for my logic (loop).
It should be something like this I think:
entry_point = CHEF::...getEntryPointDir
entry_point.glob..
.each do
template fname do
...
end
end
I would appreciate any help!