Some plugins may not fit for every project that is leveraging Vagrant. As is, all plugins which are installed are loaded when Vagrant starts. It would be awesome if a plugin author had the option to lazily load their plugins and require users to manually require these plugins in their Vagrantfile.
A good example plugin which may not need to be loaded for every project is Berkshelf-Vagrant. We're currently taking steps to add our own 'enable' configuration flag which will cause the middleware to do a no-op.
Sort of relates to #1700 as well if implemented correctly.
I could envision the Vagrantfile then accepting something like:
Vagrant.configure("2") do |config|
# simple load
# maybe more advanced logic
config.plugin 'vagrant-berkshelf' do |plugin|
Where it could install the plugin automatically if it's not available and fix your lazy loading issue.
For reference, here's the offending code when a Vagrant environment is spinning up that loads all external plugins:
Maybe the load_plugins function should be unprotected or moved closer to the Vagrant kernel and optionally take an array of plugins to load (nil loading all)?
Hey guys, here's my take on the problem: https://github.com/fgrehm/vundler :)
I think for now delegating this out to Vundler is ideal. Closing.
Why not move it into core instead of having to have everyone use a plugin to manage plugins?
Yo dawg, I heard you like plugins, so we let you manage your plugins with a plugin.
The goal is to eventually move this into core, but this provides a good stand-in.
👍 This definitely should be part of the core and I hope to see it there soon!
I though like the approach of specifying dependency plugins in https://github.com/tknerr/vagrant-plugin-bundler better than with Binder as the vast majority of projects won't have too many plugins and having a separate file is a bit of a overkill. You can with the approach of vagrant-plugin-bundler, you can parse an external file in .json, .yml, or any other format easily (if you really need it). What if those dependencies are determined at runtime, etc.
Please, please include this in the core. Typing vagrant up is magic. Having to separately install anything diminishes the magic.
Why is this closed? vagrant-plugin-bundler and Vundler are both unmaintained leaving this unsolved.
Shouldn't this fucntionality be in core??
I'm running into vagrant-librarian-puppet being incompatible with puppet-aws when its parallelizing. It would be great to not have to uninstall a plugin to disable it...
Same situation as @jhoblitt - I use vagrant-vbguest which only supports Linux, so it breaks my OSX Vagrant boxes...
Same situation as @amontalban, vargrant-vbguest works with Linux, but breaks FreeBSD.
I love vagrant-sshfs which works great for vagrant-libvirt but breaks with vagrant-lxc :(
So @mitchellh please consider this functionality in vagrant-core, because the the workaround you proposed isn't valid anymore now that vundler is not maintained anymore.
Really? Is there no native way to disable plugins on a per-environment basis?