FileEdit in Chef giving error in Windows -
i trying replace string of xml file. tried following recipe. didn't work
ruby_block 'replace_file' block f= chef::util::file_edit.new('c:\chef_file_edit\server.xml') f.search_file_replace(8081,8080) f.write_file end end
my moto replace 8081 8080. wrong in above recipe?
use strings instead of integers, f.search_file_replace('8081', '8080')
. worth noting use of fileedit highly, highly not recommended. leads brittle systems. using template
or cookbook_file
resource control server.xml
file going better solution.
Comments
Post a Comment