I'm new in chef and cookbook. I'm creating a cookbook, and I want to append at the end of file some contents (text). At the moment, I'm using:
file "#{node['dir']}/#{params[:name]}.txt" do
content "my full text"
end
but I must always append in the "content" the old content because it will overwrite. Is there another way to append contents?
Thank you pasquy
You could you use direct ruby code if you wanted like
That could be done in a ruby_block provider if you wanted. This link describes how to use that type of block
Another alternative is to read in your files contents and then concatenate that with the updated string in your current block?