On Mon, Feb 17, 2014 at 12:37:15AM -0800, [email protected] wrote:
> I'd like to add two boxes called *primary* and *secondary* to a
> Vagrantfile, but only startup *primary* when I run
>
> vagrant up
>
> Starting the *secondary* box would require an explicit
>
> vagrant up secondary
>
> Is this possible?
It doesn't look like it's a *supported* configuration, but if you wanted to
go all uber-monkey-patch you could rip the VMs you didn't want to start
out of the @__defined_vm_keys array inside your VM config. I would imagine
(but haven't tested) that something like:
config.vm.instance_variable_get(:@__defined_vm_keys).delete(:secondary)
would do the trick.
Patching Vagrant to support this functionality properly doesn't look like it
would be ridiculously difficult. Support an :autostart => false option to
define, add VMs to a new "autostart" array, and use *that* to determine what
to start instead of defined_vm_keys if no VM(s) are listed on the `vagrant
up` command line. I'll leave that as an exercise for the reader (become
famous, submit a patch to Vagrant today!)
- Matt
--
If you are a trauma surgeon and someone dies on your table, [...] everyone
would know you "did your best". When someone does something truly stupid
with their system and it dies and you can't resuscitate it, you must be
incompetent or an idiot. -- Julian Macassey, in the Monastery
--
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.