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 -- This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list. GitHub Issues: https://github.com/mitchellh/vagrant/issues IRC: #vagrant on Freenode --- You received this message because you are subscribed to the Google Groups "Vagrant" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/4a38e763-8a9b-436f-acfe-c04a3cdeb247%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
