Best bet: use Chef::Config['file_cache_path'] , which is used by the chef to store temporary data. Ie: template "#{Chef::Config['file_cache_path']}/myfile.xml" do
To the left (paraphrased) after the comment, as it still stands there for general purposes:
In accordance with the comment, the runtime resource will work in any case with this input to ensure proper configuration of the application, the file should be present only when the runtime resource starts, in other cases, remember that the following is indicated.
One of the chef's key ideas is idempotency, the chef can work 100 times and do something only when necessary.
In this case, the template will be generated once and will never be changed if there is no parameter in the attributes.
In this case (the resulting file must be updated), the chef will notice it, replace it and act accordingly with any notification defined on it.
Tensibai
source share