I got some help and the following can be done if used directly in the
vagrantfile
"10.10.10.11 10.10.10.12".scan(/\S+/)
although I am unable to substitute the variable that I export. If before
running vagrant up I export the variable
export LIST_OF_IP="10.10.10.11 10.10.10.12"
and
I tried to do the following:
CFG_IP="$LIST_IPS".split(",") or CFG_IP="$LIST_IPS".split(" ")
Neither worked and added a debug to understand
DEBUG create_networks: In config found network type private_network options
{:ip=>"$LIST_IPS", :protocol=>"tcp",
Thank you Alvaro. This certainly helps but since I am exporting a space
separated(or comma separated) variable of IP addresses can I perform
operations on the env var in the vagrantfile for it to become a list that u
mentioned
export LIST_IP="10.10.10.10 10.10.10.11"
in Vagrantfile:
you can use:
["192.168.11.11", "192.168.12.12"].to_enum.with_index(1).each do |ip, i|
then you can use the ip and/or the index/counter i
On Sun, Feb 4, 2018 at 10:39 PM, Shashank Korada
wrote:
> Turns out I cant be exporting an array in bash.
> So I now want to