"Fossies" - the Fresh Open Source Software Archive

Member "vagrant-2.2.14/website/pages/docs/plugins/action-hooks.mdx" (20 Nov 2020, 2976 Bytes) of package /linux/misc/vagrant-2.2.14.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 ---
    2 layout: docs
    3 page_title: Plugin Development Basics - Action Hooks
    4 sidebar_title: Action Hooks
    5 description: |-
    6   Action hooks provide ways to interact with Vagrant at a very low level by
    7   injecting middleware in various phases of Vagrant's lifecycle. This is an
    8   advanced option, even for plugin development.
    9 ---
   10 
   11 # Action Hooks
   12 
   13 Action hooks provide ways to interact with Vagrant at a very low level by
   14 injecting middleware in various phases of Vagrant's lifecycle. This is an
   15 advanced option, even for plugin development.
   16 
   17 ~> **Warning: Advanced Topic!** Developing plugins is an
   18 advanced topic that only experienced Vagrant users who are reasonably
   19 comfortable with Ruby should approach.
   20 
   21 ## Public Action Hooks
   22 
   23 The following action hooks are available in the core of Vagrant. Please note
   24 that this list is not exhaustive and additional hooks can be added via plugins.
   25 
   26 - `environment_plugins_loaded` - called after the plugins have been loaded,
   27   but before the configurations, provisioners, providers, etc. are loaded.
   28 
   29 * `environment_load` - called after the environment and all configurations are
   30   fully loaded.
   31 
   32 - `environment_unload` - called after the environment is done being used. The
   33   environment should not be used in this hook.
   34 
   35 * `machine_action_boot` - called after the hypervisor has reported the machine
   36   was booted.
   37 
   38 - `machine_action_config_validate` - called after all `Vagrantfile`s have been
   39   loaded, merged, and validated.
   40 
   41 * `machine_action_destroy` - called after the hypervisor has reported the
   42   virtual machine is down.
   43 
   44 - `machine_action_halt` - called after the hypervisor has moved the machine
   45   into a halted state (usually "stopped" but not "terminated").
   46 
   47 * `machine_action_package` - called after Vagrant has successfully packaged a
   48   new box.
   49 
   50 - `machine_action_provision` - called after all provisioners have executed.
   51 
   52 * `machine_action_read_state` - called after Vagrant has loaded state from
   53   disk and the hypervisor.
   54 
   55 - `machine_action_reload` - called after a virtual machine is reloaded (varies
   56   by hypervisor).
   57 
   58 * `machine_action_resume` - called after a virtual machine is moved from the
   59   halted to up state.
   60 
   61 - `machine_action_run_command` - called after a command is executed on the
   62   machine.
   63 
   64 * `machine_action_ssh` - called after an SSH connection has been established.
   65 
   66 - `machine_action_ssh_run` - called after an SSH command is executed.
   67 
   68 * `machine_action_start` - called after the machine has been started.
   69 
   70 - `machine_action_suspend` - called after the machine has been suspended.
   71 
   72 * `machine_action_sync_folders` - called after synced folders have been set up.
   73 
   74 - `machine_action_up` - called after the machine has entered the up state.
   75 
   76 ## Private API
   77 
   78 You may find additional action hooks if you browse the Vagrant source code, but
   79 only the list of action hooks here are guaranteed to persist between Vagrant
   80 releases. Please do not rely on the internal API as it is subject to change
   81 without notice.