diff --git a/lib/vagrant/environment.rb b/lib/vagrant/environment.rb index 677d5c971..dc2d7a8a1 100644 --- a/lib/vagrant/environment.rb +++ b/lib/vagrant/environment.rb @@ -131,6 +131,10 @@ module Vagrant # Load the plugins load_plugins + # Call the hooks that does not require configurations to be loaded + # by using a "clean" action runner + hook(:environment_plugins_loaded, Action::Runner.new) + # Call the environment load hooks hook(:environment_load) end @@ -268,10 +272,10 @@ module Vagrant # against the given name will be run in the context of this environment. # # @param [Symbol] name Name of the hook. - def hook(name) + def hook(name, runner = action_runner) @logger.info("Running hook: #{name}") callable = Action::Builder.new - action_runner.run( + runner.run( callable, :action_name => name, :env => self)