fix CHEF-4933

for fix CHEF-4933, I replaced the configfile writing/deleting code with file resource.