hello,
for q1, I have seen things like this:
config.vm.provider :vmware_fusion do |vb, override|
override.vm.box_url =
"http://storage.core-os.net/coreos/amd64-usr/alpha/coreos_production_vagrant_vmware_fusion.box"
end
perhaps you can test inside a data block like that?
for 2, you mean ruby script as script.rb? if yes, then the shell inline
will be executed only when the machine is provisioned
you can copy the script into the guest, and execute it like:
config.vm.provision :file, :source => "/path/myawesomescript",
:destination => "/myawesomescript"
config.vm.provision :shell, :inline => "ruby /myawesomescript"
Alvaro.
On Fri, Mar 28, 2014 at 12:28 AM, <[email protected]> wrote:
> Hi,
>
> I've a single Vagrantfile that is used for multiple providers (e.g.,
> VirtualBox, Softlayer, etc).
>
> 1. I would like to call a different ruby script (or ruby function) for
> each profvider from the Vagrantfile. How I can check the provider in the
> Vagrantfile ?
>
> 2. In addition, I would like to run the ruby script if and only if the
> provision flag is set. That is, if vagrant is NOT executed with the
> --no-provision flag. How I can check the provision flag in the Vagrantfile ?
>
> Thanks In Advance,
>
> -- Idan Zach
>
> --
> 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.