Skip to content

Instantly share code, notes, and snippets.

@ss44
Created February 5, 2015 16:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ss44/83e5138e404ffb78e935 to your computer and use it in GitHub Desktop.
Save ss44/83e5138e404ffb78e935 to your computer and use it in GitHub Desktop.
Automatically install required vagrant plugins from within a vagrant script, as opposed to requiring users first install the needed plugins first. Not sure if this will cause any other issues but it does streamline the entire vagrant process.
required_plugins = %w( vagrant-hostsupdater vagrant-vbguest )
_retry = false
required_plugins.each do |plugin|
unless Vagrant.has_plugin? plugin
system "vagrant plugin install #{plugin}"
_retry = true
end
end
if (_retry)
exec "vagrant " + ARGV.join(' ')
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment