Hello
vagrantfile is ruby

so you can use ruby magic, ie variables

or, what I would do would be:

create this structure

myawesomebox/0.0.0
myawesomebox/0.1.0
myawresomebox/1.0.0

and put a vagrantfile there on each directory

then, you can use

myversion  = Pathname.new(Dir.getwd).basename.to_s

and that variable will be the name of the direcrtory

i use that to name the box as the directory, but in your case you can
use it to grab de version.

Alvaro



On Fri, Sep 25, 2015 at 1:51 AM, Francois Marot
<[email protected]> wrote:
> Hello all,
>
> I have a simple problem: I have many versions of a box, defined in a
> standard metadata.json file referenced in my Vagrantfile. I will have to
> regularly switch between versions (to test & compare regressions for
> example) of boxes. i'd like to avoid hardcoding the box version I want to
> use in my Vagrantfile (config.vm.box_version parameter).
> So is there a way to specify on the 'vagrant up' command-line which version
> I want to use ? The "--box-version" parameter available for some other
> command seems not supported :(
>
> --
> This mailing list is governed under the HashiCorp Community Guidelines -
> https://www.hashicorp.com/community-guidelines.html. Behavior in violation
> of those guidelines may result in your removal from this mailing list.
>
> GitHub Issues: https://github.com/mitchellh/vagrant/issues
> IRC: #vagrant on Freenode
> ---
> 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].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/vagrant-up/02041ceb-bd45-4c8a-8d94-3bafdfc65b03%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
--- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vagrant-up/CAHqq0ezTtX6xQYaMy0HnTh%3Dhi0O%3D-CA%3DaAppzp93EpkE2FnMpw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to