I am having node['server']['ipaddress'] attribute that includes 3 ip addresses as below:
node['server']['ipaddress']=["10.211.241.21", "10.211.241.20", "10.211.241.22"]
I am now trying to use the above values in a chef bash resource
bash 'configure_engine_discovery' do
code <<-EOH
echo `docker run --server ipaddress1 --server ipaddress2 --server ipaddress3 --update`
EOH
end
There might be more than 3 ipaddresses and I want to make the above bash command more dynamic so that the I don't require to change the bash every time and it can accommodate any number of server ips