»Action Hooks

Action hooks provide ways to interact with Vagrant at a very low level by injecting middleware in various phases of Vagrant's lifecycle. This is an advanced option, even for plugin development.

»Public Action Hooks

The following action hooks are available in the core of Vagrant. Please note that this list is not exhaustive and additional hooks can be added via plugins.

  • environment_plugins_loaded - called after the plugins have been loaded, but before the configurations, provisioners, providers, etc. are loaded.
  • environment_load - called after the environment and all configurations are fully loaded.
  • environment_unload - called after the environment is done being used. The environment should not be used in this hook.
  • machine_action_halt - called after the hypervisor has moved the machine into a halted state (usually "stopped" but not "terminated").

»Private API

You may find additional action hooks if you browse the Vagrant source code, but only the list of action hooks here are guaranteed to persist between Vagrant releases. Please do not rely on the internal API as it is subject to change without notice.