Moonshine-IDE / VagrantRoyaleExample

Vagrant script to start server to run Apache Royale Project
0 stars 0 forks source link

Automatically Install vagrant-vbguest Plugin #2

Open JoelProminic opened 2 years ago

JoelProminic commented 2 years ago

This page has some suggestions for automatically installing vagrant-vbguest from Vagrantfile:

We have used this snippet in another project:

unless Vagrant.has_plugin?("vagrant-vbguest")
  puts 'Installing vagrant-vbguest Plugin...'
  system('vagrant plugin install vagrant-vbguest')
end

However, I see that Vagrant now [supports]() defining the required projects in the configuration. Unfortunately, this has a confirmation prompt, so it may cause trouble for Moonshine.

config.vagrant.plugins = ["vagrant-vbguest"]
JoelProminic commented 2 years ago

I also found that the config.vagrant.plugins solution requires rerunning the command after the plugin is installed:

% vagrant up  2>&1 | tee tmp.log
Vagrant has detected project local plugins configured for this
project which are not installed.

  vagrant-vbguest
Install local plugins (Y/N) [N]: y
Installing the 'vagrant-vbguest' plugin. This can take a few minutes...
Installed the plugin 'vagrant-vbguest (0.30.0)'!

Vagrant has completed installing local plugins for the current Vagrant
project directory. Please run the requested command again.