Hello
I want to do conditionally network configuration in vagrantfile but my condition (ENV['ENV'] == 'local') always getting false.
can someone plese suggest me what is wrong in this
This is my code
Vagrant.configure(2) do |config|
config.vm.box = "vStone/centos-7.x-puppet.3.x"
config.vm.hostname = "LOCAL-BOX"
config.vm.box_check_update = false
if ENV['ENV'] == 'local'
config.vm.network "private_network", ip: ENV['SYS_IP']
else
config.vm.network "public_network", bridge: 'enp4s0', ip: ENV['SYS_IP']
end
end
I am calling above code by SYS_IP=serverip, ENV="local" vagrant up
Thanks