Thanks Andrew,i pasted the wrong code , i fixed that _ vs "-" thing , but it still did not work ,same errorChef Client failed. 0 resources updated[2013-10-29T13:36:43-07:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out[2013-10-29T13:36:43-07:00] FATAL: NoMethodError: undefined method `each' for nil:NilClassYou have mail in /var/spool/mail/deploycookbook_file "/local_app/account-rest.properties" dosource "account-rest.properties"mode 0777owner "deploy"group "deploy"endruby_block "acc-deploy-host" doblock dohost=`hostname -s`node.set[:acc-deploy] = `cat /local_app/account-rest.properties | grep -i "#{host}" | cut -d":" -f2 `puts "value is #{node[:acc-deploy]}"endaction :createendnode['acc-deploy'].each do |x|puts #xendOn Tue, Oct 29, 2013 at 1:32 PM, Andrew Gross < " target="_blank"> > wrote:
In the first case you use a dash node.set[:acc-deploy]
In the second case you are using underscore node['acc_deploy'].eachAdditionally I would recommend standardizing on symbols vs stringsHopefully that works.On Tue, Oct 29, 2013 at 4:27 PM, Manoj Thakkar < " target="_blank"> > wrote:i changed the code to this ,still does not work , what is wrong ?cookbook_file "/local_app/account-rest.properties" dosource "account-rest.properties"mode 0777owner "deploy"group "deploy"endruby_block "acc-deploy-host" doblock donode.set[:acc-deploy] = `cat /local_app/account-rest.properties | grep -i "#{host}" | cut -d":" -f2 `puts "value is #{node["acc-deploy"]}"endaction :createendnode['acc_deploy'].each do |x|puts #xendOn Tue, Oct 29, 2013 at 1:17 PM, Manoj Thakkar < " target="_blank"> > wrote:
Hey,i have been trying to fix this for almost 30 minutes now , thought i shall better ask, please looks at the code snippet below, I am not able to access this simple variable what am i doing wrong ? please advise.cookbook_file "/local_app/account-rest.properties" dosource "account-rest.properties"mode 0777owner "deploy"group "deploy"endruby_block "acc-deploy-host" doblock donode.default["acc-deploy"] = `cat /local_app/account-rest.properties | grep -i "#{host}" | cut -d":" -f2 `puts "value is #{node["acc-deploy"]}"endaction :createendnode[:acc_deploy].each do |x| ----- this does not workputs #xend
Archive powered by MHonArc 2.6.16.