hello, you need host -> vm or vm -> vm communication? if vm -> vm, have a look at Vagrant multi machine, you can set a fixed ip, and use that ip to create /etc/hosts updated
ie: #agent box (1..2).each do |i| vm_name = "agent#{i}" config.vm.define vm_name do |agent| agent.vm.box = "alvaro/oracle6-agent" agent.vm.hostname = vm_name agent.vm.network "public_network", ip: "192.168.10.#{10+i}" agent.vm.network "forwarded_port", guest: 80, host: 8000+i end end <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> This email has been sent from a virus-free computer protected by Avast. www.avast.com <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> <#DDB4FAA8-2DD7-40BB-A1B8-4E2AA1F9FDF2> On Wed, Jan 27, 2016 at 5:15 PM, Stathy Touloumis <goo...@stathy.com> wrote: > Is there documentation as to how I can capture machine information that > can be used during the provision process/scripts? > > I'd like to create a hosts file based on a number of machines that come up > and push the host file to all the machines during provisioning. So > something like > > vagrant up h1 h2 h3 --no-provision > > vagrant provision h1 h2 h3 > <do stuff based on configuration of the all the machines that have been > setup> > > 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 vagrant-up+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/vagrant-up/ec64b5a7-053e-4d0c-8859-43f4239d54c6%40googlegroups.com > <https://groups.google.com/d/msgid/vagrant-up/ec64b5a7-053e-4d0c-8859-43f4239d54c6%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 vagrant-up+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CAHqq0ewABoEMuwvASGQomdyhUK5jKuoBptZ4YZ8ovqPWhQ1kNg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.