Open ergonlogic opened 9 years ago
vagrant global-status
provides us everything we need:
id name provider state directory
------------------------------------------------------------------------------------------------------------------
e176eb1 valkyrie virtualbox poweroff /home/ergonlogic/vagrant/projects/13
0bed096 valkyrie virtualbox poweroff /home/ergonlogic/vagrant/projects/15
2892219 valkyrie virtualbox running /home/ergonlogic/vagrant/projects/rel0
Unfortunately, it doesn't yet implement the --machine-readable
option: https://github.com/mitchellh/vagrant/issues/4097
Still, it should be pretty easy to parse that, and loop over running VMs named 'valkyrie'.
This should probably happen in a pre-up
hook.
Marking as postponed. We could work on that upstream issue, if we really want to push this forward.
We hard-code the IP address, among other things, so these kind of collisions will cause all kinds of hard-to-diagnose issues.