hello, probably ENV is a reserved word

Can you try with a different name for that var?

On Sun, Jan 17, 2016 at 3:28 AM, govind parashar <[email protected]>
wrote:

> 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
> <https://groups.google.com/d/msgid/vagrant-up/4a38e763-8a9b-436f-acfe-c04a3cdeb247%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAHqq0eyT6TTiBJ9w%2B1ZotBS2ebhAj68ccJP07HEmhENMiMyxrw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to