I try with the
ruby_block 'Lookup IPs' do
block do
Chef::Resource::RubyBlock.send(:include, Chef::Mixin::ShellOut)
command = 'bash /tmp/ListELBInstanceIPs.sh'
command_out = shell_out(command)
node.default['my_ips'] = command_out.stdout.strip
end
action :create
end
This rubyblock is not working with the chef13 client, Can any one has any idea on this issue please keep me posted.
Do you have an error ?
From what I see, I would use an include instead of using send() which is probably too late as your ruby_block is already created.
I am trying to get the IPS from ELB(AWS load balancer ) it's not reading that values
Does your bash script works if you run it from a terminal ?
Yes, it working and I am getting IPS.
ruby_block 'Lookup IPs' do
block do
Chef::Resource::RubyBlock.send(:include, Chef::Mixin::ShellOut)
command = 'bash /tmp/ListELBInstanceIPs.sh'
command_out = shell_out(command)
Chef::Log.warn(command_out.stdout * 20)
node.default['my_ips'] = command_out.stdout.strip
end
action :create
end
Run this and let me know what do you have in your chef client logs.
Thanks