This is old, I know but did you ever solve this gracefully? I'm working in a similar space, and have a particular solution in mind that I'd like to socialize. I'd have emailed you directly but I can't.
My solution basically is : Vagrantfile of defined hashes of : host list with details (IP, hostname, chef/salt roles, rolename, ...) networks firewall rules merged with Vagrantfile of : class libs provisioning iterations procedural operations along with this - I'm adding ruby code to do interesting things like have the default action be to enumerate the available VMs in the vagrant model and exit cleanly rather than to just stupidly spin them up. If this is interesting to you, I'm interested to see where you went with this and how you factored your vagrantfile(s) On Monday, September 23, 2013 9:41:32 AM UTC-5, Dan Moore wrote: > > Hello all, > This might be a bit confusing, so let me know if I'm unclear about > something. > > I'd like to have a single Vagrantfile host separate VMs for separate > projects. > > What this means is my workflow would be something like: > 1. Clone core repository (holds vagrantfile, cookbooks, etc...) ~/Projects > 2. Create an individual project VM mkdir / cd ~/Projects/project1 && > vagrant up > 3. <magic happens> > 4. mkdir ~/Projects/project2 && cd ~/Projects/project2 && vagrant up > 5. <magic happens> > > Now I have 2 separate VMs in separate folders. > > Some challenges I face for this to work: > 1. The original Vagrantfile can't have any idea what the projects names > are. Completely unrelated (some simple Ruby could scoop this up though) > 2. Port conflicts, Vagrant would ideally select the next available port, > or a random port on the host side via config > 3. Naming individual VMs, would be based off of the project folder. > > What I do not understand, is how can a single Vagrantfile be used to spawn > multiple VMs (not multi-vms on a single command)? > When does the vagrant command know that a VM is up and already exists? > What is the path that vagrant looks to see if the VM exists already? > > I realize that a subfolder vagrant command uses (inherits) the first > Vagrantfile it finds, but how does the VM get tied to that Vagrantfile? > Would this be as easy as replacing the config.vm.hostname with a different > variable per folder? > > 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/d/optout.
