I have a vagrant file, where the IP of my virtual box is hardcoded. 

    # The IP address of the first server
    primary_ip = "172.17.8.101"

I wanted to dynamically assign the ip based on my local network (corporate 
network). 

In vagrant documentation, I see we can use

The easiest way to use a private network is to allow the IP to be assigned 
via DHCP.

    Vagrant.configure("2") do |config|
      config.vm.network "private_network", type: "dhcp"
    end

https://www.vagrantup.com/docs/networking/private_network.html

In the same vagrant file, during the configuration I see that the hardcoded 
ip is referred. Now since, I am using the 'type: dhcp', how can I pass the 
IP details for the below configuration?

    host.vm.provision :shell, inline: %Q|echo 'export 
ETCD_AUTHORITY="#{primary_ip}:2379"' >> /home/vagrant/.profile|

-- 
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/c7a3a705-123d-48be-83da-4eca34ada5c5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to