One option would be to use the vagrant-hostmanager plugin (vagrant plugin install vagrant-hostmanager), take a look at the Custom IP resolver section: https://github.com/smdahlen/vagrant-hostmanager#custom-ip-resolverfor tips on getting the public ip address.
This would allow you to just use a hostname in your chef recipe or attributes. (I normally only use hostmanager with vbox VM's, but it looks like there is AWS support, for both public & private IP address usage) On 26 January 2014 13:24, Torben Knerr <[email protected]> wrote: > Looking for exactly the same thing. My first thought was shelling out to > `vagrant ssh-config other_node`, but that get's evaluated too early... > > I could imagine you could do this at the right time via the > vagrant-triggers plugin, but haven't tried it yet: > https://github.com/emyl/vagrant-triggers > > > Cheers, Torben > > > > On Sat, Jan 25, 2014 at 12:55 AM, David Petzel <[email protected]>wrote: > >> I'm trying to figure out how I can read information about one machine and >> use it to set a an attribute (chef solo provisioner) on a second instance. >> For the sake of the discussion lets say I have a two machine configuration >> using a cloud provider (not virtualbox). We'll say I have DB and WEB. I >> want to bring up the DB box first and then once its been given an IP, I >> want to grab its IP and populate a node attribute (via the chef.json hash). >> I do understand that this is easy with chef-server provisioner, but trying >> to accomplish it with chef-solo provisioner. >> >> So the pseudo code would be something like: >> web.vm.provision :chef_solo do |chef| >> chef.blah >> chef.json = {:db_server_ip => find_db_serverip()} >> end >> >> Can something like this be done? >> >> Thanks >> >> -- >> 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/groups/opt_out. >> > > -- > 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/groups/opt_out. > -- Simon McCartney E: [email protected] M: +44 7710 836 915 -- 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/groups/opt_out.
