Hello,
inside the vagrantfile you can use ruby magic like this:
#if not defined, set defaults
ENV['giver']||="12.1.0.2"
That check for the variable giver, if not defined, will setup a defaul
Then later you can call a shell provisioner like this
config.vm.provision :shell, :inline => "bash /vagrant/script.sh #{ENV['giver']}"
Note the #{} expand the variable as ruby see it.
Does this helps?
Alvaro.
On Thu, Apr 9, 2015 at 7:30 PM, Jim Klo <[email protected]> wrote:
> Relatively new to Vagrant as well as Ruby.
>
> I've got a multi-box Vagrantfile and wondering if there's a way for me to
> pass additional command-line arguments to vagrant-up that I can process
> within the Vagrantfile.
>
> For example, I've got a VM that provisions a server by default against a
> specific official release of a source repo, however I'd like to have the
> ability to just pass an argument or flag that can be processed to do some
> additional provisioning by changing the source repo to different branch. I
> suppose I could do this using subsequent calls after the vagrant-up with
> vagrant-ssh, but was hoping to have a handy one-liner.
>
> Thanks,
>
> - Jim
>
> --
> 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.
--
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.