- From: Douglas Thrift <
>
- To:
- Subject: [chef] Re: Re: not able to run command in ruby block
- Date: Tue, 29 Oct 2013 17:28:35 -0700
He should probably use mixlib-shellout, but the backticks are inside of
the ruby_block's block so they are evaluated at converge time. Are you
actually sure that it isn't printing out? You should probably use
Chef::Log.info rather than puts.
Douglas William Thrift
<
>
<
http://douglasthrift.net/>
On 10/29/2013 4:50 PM, Sean OMeara wrote:
>
Your backticks are being evaluatied during the compilation phase of the
>
chef-client run.
>
You want this: https://github.com/opscode/mixlib-shellout
>
>
-s
>
>
On Tue, Oct 29, 2013 at 6:26 PM, Manoj Thakkar
>
<
>
<mailto:
>>
>
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.