Hi,i am updating a file using cookbook file and then reading the contents of the file ,The file do get updated ion the client , but when i read the file the file always read the previous content not the updated one,I am not sure whats wrong here, please advise.Here is the properties file i am updatingpbldejksu300:acc1,acc2pdevecsas300:acc1,acc4ppdsecsas300:acc1,acc2here is the chef recipeookbook_file "/local_app/#{node[:tcat][:war_name]}.properties" dosource "#{node[:tcat][:war_name]}.properties"mode 0777owner "deploy"group "deploy"endChef::Log.info " host name is #{node['hostname']} "host=node['hostname']puts " hostname is #{host}"output=Array.newoutput1=`cat /local_app//#{node[:tcat][:war_name]}.properties | grep -i "#{host}" | cut -d":" -f2 `#output1.chomp#output1.delete("\n")#output1.rstrip()output1.gsub!(/(\n*)$/, '')output=output1.split","node.set[:acc_deploy]=output#Chef::Log.info "Found correct value #{output1}, &&&& #{output} "Chef::Log.info "Found correct value again #{node['acc_deploy']} "node[:acc_deploy].each do |data|data.chompChef::Log.info "Found correct value wow #{data} "directory "/local_app/test/#{data}" doowner "deploy"group "deploy"mode 0755action :createnotifies :run, "bash[inst_tcat_#{data}]", :immediatelyendbash "inst_tcat_#{data}" docode <<-EOSset -e -xpwdtouch /local_app/test/#{data}/abc.txtEOSaction :nothingChef::Log.info "Found correct value in the loop now #{data}"endendHere is the client logs .... as you see in the log it changed the file content but still processed the old file data that was acc1,acc2,acc3- create a new cookbook_file /local_app/order-rest.properties--- /local_app/order-rest.properties 2013-11-18 10:56:04.408395557 -0800+++ /var/chef/cache/cookbooks/base_tomcat/files/default/order-rest.properties 2013-11-18 10:59:03.826165321 -0800@@ -1,3 +1,3 @@pbldejksu300:acc1,acc2-pdevecsas300:acc1,acc2,acc3+pdevecsas300:acc1,acc4ppdsecsas300:acc1,acc2* directory[/local_app/test/acc1] action create[2013-11-18T10:59:03-08:00] INFO: Processing directory[/local_app/test/acc1] action create (base_tomcat::new1 line 26)(up to date)* bash[inst_tcat_acc1] action nothing[2013-11-18T10:59:03-08:00] INFO: Processing bash[inst_tcat_acc1] action nothing (base_tomcat::new1 line 34)(up to date)* directory[/local_app/test/acc2] action create[2013-11-18T10:59:03-08:00] INFO: Processing directory[/local_app/test/acc2] action create (base_tomcat::new1 line 26)(up to date)* bash[inst_tcat_acc2] action nothing[2013-11-18T10:59:03-08:00] INFO: Processing bash[inst_tcat_acc2] action nothing (base_tomcat::new1 line 34)(up to date)* directory[/local_app/test/acc3] action create[2013-11-18T10:59:03-08:00] INFO: Processing directory[/local_app/test/acc3] action create (base_tomcat::new1 line 26)[2013-11-18T10:59:03-08:00] INFO: directory[/local_app/test/acc3] created directory /local_app/test/acc3- create new directory /local_app/test/acc3[2013-11-18T10:59:03-08:00] INFO: directory[/local_app/test/acc3] owner changed to 101[2013-11-18T10:59:03-08:00] INFO: directory[/local_app/test/acc3] group changed to 57001[2013-11-18T10:59:03-08:00] INFO: directory[/local_app/test/acc3] mode changed to 755
Archive powered by MHonArc 2.6.16.