[chef] Re: not able to run command in ruby block


Chronological Thread 
  • From: Sean OMeara < >
  • To: " " < >
  • Subject: [chef] Re: not able to run command in ruby block
  • Date: Tue, 29 Oct 2013 19:50:40 -0400

Your backticks are being evaluatied during the compilation phase of the chef-client run.

-s

On Tue, Oct 29, 2013 at 6:26 PM, Manoj Thakkar < " target="_blank"> > wrote:
HI, this is what my code looks like , somehow the #{host} below is not replaced correctly in the grep,

any clues why ? 
 

 ruby_block "acc-deploy-host" do

 block do
 host=`hostname -s`
 node.set[:acc_deploy] = `cat /local_app/account-rest.properties | grep -i "#{host}" | cut -d":" -f2 `
 puts "value is #{node['acc_deploy']}"
end
 end

Thanks
Manoj





Archive powered by MHonArc 2.6.16.

§