I want to use private ip address later in my Chef recipe for that how can I catch it in a variable. My code looks like...
execute 'privateip' do
command 'curl http://169.254.169.254/latest/meta-data/local-ipv4'
action :run
end
I want to catch the output of curl command in a variable something like..
privip = 'curl http://169.254.169.254/latest/meta-data/local-ipv4'
and then use that value in configuration file OR is there any way to get the private ipaddresses of aws instance, because ohai doesn't support the privateip
attribute. Any help will highly appreciated.