» Action Hooks
Action hooks provide ways to interact with Vagrant at a very low level byinjecting middleware in various phases of Vagrant's lifecycle. This is anadvanced option, even for plugin development.
Warning: Advanced Topic! Developing plugins is anadvanced topic that only experienced Vagrant users who are reasonablycomfortable with Ruby should approach.
» Public Action Hooks
The following action hooks are available in the core of Vagrant. Please notethat 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 arefully loaded.environment_unload
- called after the environment is done being used. Theenvironment should not be used in this hook.machine_action_boot
- called after the hypervisor has reported the machinewas booted.machine_action_config_validate
- called after allVagrantfile
s have beenloaded, merged, and validated.machine_action_destroy
- called after the hypervisor has reported thevirtual machine is down.machine_action_halt
- called after the hypervisor has moved the machineinto a halted state (usually "stopped" but not "terminated").machine_action_package
- called after Vagrant has successfully packaged anew box.machine_action_provision
- called after all provisioners have executed.machine_action_read_state
- called after Vagrant has loaded state fromdisk and the hypervisor.machine_action_reload
- called after a virtual machine is reloaded (variesby hypervisor).machine_action_resume
- called after a virtual machine is moved from thehalted to up state.machine_action_run_command
- called after a command is executed on themachine.machine_action_ssh
- called after an SSH connection has been established.machine_action_ssh_run
- called after an SSH command is executed.machine_action_start
- called after the machine has been started.machine_action_suspend
- called after the machine has been suspended.machine_action_sync_folders
- called after synced folders have been set up.machine_action_up
- called after the machine has entered the up state.
» Private API
You may find additional action hooks if you browse the Vagrant source code, butonly the list of action hooks here are guaranteed to persist between Vagrantreleases. Please do not rely on the internal API as it is subject to changewithout notice.