diff options
-rw-r--r-- | Vagrantfile | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/Vagrantfile b/Vagrantfile index 7ded6b89..c3f3b08a 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -4,6 +4,17 @@ # Vagrantfile API/syntax version. Don't touch unless you know what you're doing! VAGRANTFILE_API_VERSION = "2" +new_plugin_installed = false +unless Vagrant.has_plugin?('vagrant-vbguest') + plugin = 'vagrant-vbguest' + puts "Missing plugin #{plugin}, installing..." + + `vagrant plugin install #{plugin}` + + new_plugin_installed = true +end +exec "vagrant #{ARGV.join' '}" if new_plugin_installed + Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # All Vagrant configuration is done here. The most common configuration # options are documented and commented below. For a complete reference, @@ -18,10 +29,6 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.box = "leap-wheezy" - unless Vagrant.has_plugin?("vagrant-vbguest") - raise 'plugin vagrant-vbguest is not installed! Please run `vagrant plugin install vagrant-vbguest`' - end - config.vbguest.auto_update = false config.vm.define "source", primary: true do |source| |