Sorry for the late reply; that plugin didn't provide a solution to the general question (i.e. I still know of no way for a Vagrant process to extract information *back* from the hosts it creates/provisions), but it does solve my particular problem here. I was able to provision my application nodes with configurations pointing to the host names I selected up-front, rather than the IP addresses generated during spin-up. As a bonus, setting hostmanager.manage_host to true also updated my local /etc/hosts file, which effectively turned the machine on which I was running Vagrant into a jump box for all of my newly-provisioned VMs.
Thanks for the link -- works great! On Friday, August 15, 2014 7:23:27 PM UTC-4, Alvaro Miranda Aguilera wrote: > > have you seen this plugin? > > https://github.com/smdahlen/vagrant-hostmanager > > > > On Sat, Aug 16, 2014 at 9:06 AM, Branden Smith <[email protected] > <javascript:>> wrote: > >> Is there any way to retrieve information about hosts spawned by a >> Vagrant process, while still within the Ruby process executing the >> Vagrantfile? >> >> I'm using Vagrant in conjunction with the vagrant-google plugin >> <https://github.com/mitchellh/vagrant-google> to spin up a series of >> hosts within Google Cloud Engine. GCE assigns each host an IP address, and >> I need to reference the full list of IP addresses (for all hosts) in >> configurations created by subsequent provisioning steps on each host. I >> considered trying to scrape output from ifconfig as executed by the >> shell provisioner, but I cannot find a way to get the shell provisioner to >> return output or return values back to the Vagrantfile process. >> >> Any suggestions are appreciated; if Vagrant is the wrong tool for what >> I'm describing, please advise if you can suggest a more appropriate one (or >> a plugin). >> >> >> *(cross-posted to Stack Overflow: >> http://stackoverflow.com/questions/25333099/retrieving-information-about-vagrant-spawned-hosts-from-within-vagrantfile-execu >> >> <http://stackoverflow.com/questions/25333099/retrieving-information-about-vagrant-spawned-hosts-from-within-vagrantfile-execu>)* >> >> -- >> 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] <javascript:>. >> For more options, visit https://groups.google.com/d/optout. >> > > -- 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]. For more options, visit https://groups.google.com/d/optout.
