Module: VagrantPlugins::QEMU::Action
- Includes:
- Vagrant::Action::Builtin
- Defined in:
- lib/vagrant-qemu/action.rb,
lib/vagrant-qemu/action/import.rb,
lib/vagrant-qemu/action/destroy.rb,
lib/vagrant-qemu/action/read_state.rb,
lib/vagrant-qemu/action/stop_instance.rb,
lib/vagrant-qemu/action/warn_networks.rb,
lib/vagrant-qemu/action/mount_virtiofs.rb,
lib/vagrant-qemu/action/start_instance.rb,
lib/vagrant-qemu/action/message_not_created.rb,
lib/vagrant-qemu/action/message_already_created.rb,
lib/vagrant-qemu/action/message_will_not_destroy.rb,
lib/vagrant-qemu/action/prepare_forwarded_port_collision_params.rb
Defined Under Namespace
Classes: Destroy, Import, MessageAlreadyCreated, MessageNotCreated, MessageWillNotDestroy, MountVirtioFS, PrepareForwardedPortCollisionParams, ReadState, StartInstance, StopInstance, WarnNetworks
Class Method Summary collapse
-
.action_destroy ⇒ Object
This action is called to terminate the remote machine.
-
.action_halt ⇒ Object
This action is called to halt the remote machine.
- .action_package ⇒ Object
-
.action_provision ⇒ Object
This action is called when ‘vagrant provision` is called.
-
.action_read_state ⇒ Object
This action is called to read the state of the machine.
- .action_reload ⇒ Object
-
.action_ssh ⇒ Object
This action is called to SSH into the machine.
- .action_ssh_run ⇒ Object
- .action_start ⇒ Object
-
.action_up ⇒ Object
This action is called to bring the box up from nothing.
Class Method Details
.action_destroy ⇒ Object
This action is called to terminate the remote machine.
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/vagrant-qemu/action.rb', line 34 def self.action_destroy Vagrant::Action::Builder.new.tap do |b| b.use Call, DestroyConfirm do |env, b2| if env[:result] b2.use ConfigValidate b2.use Call, IsState, :not_created do |env2, b3| if env2[:result] b3.use MessageNotCreated next end b3.use ProvisionerCleanup, :before if defined?(ProvisionerCleanup) b3.use StopInstance b3.use Destroy b3.use SyncedFolderCleanup end else b2.use MessageWillNotDestroy end end end end |
.action_halt ⇒ Object
This action is called to halt the remote machine.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/vagrant-qemu/action.rb', line 18 def self.action_halt Vagrant::Action::Builder.new.tap do |b| b.use ConfigValidate b.use Call, IsState, :not_created do |env, b2| if env[:result] b2.use MessageNotCreated next end b2.use StopInstance b2.use SyncedFolderCleanup end end end |
.action_package ⇒ Object
11 12 13 14 15 |
# File 'lib/vagrant-qemu/action.rb', line 11 def self.action_package lambda do |env| raise Errors::NotSupportedError end end |
.action_provision ⇒ Object
This action is called when ‘vagrant provision` is called.
58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/vagrant-qemu/action.rb', line 58 def self.action_provision Vagrant::Action::Builder.new.tap do |b| b.use ConfigValidate b.use Call, IsState, :not_created do |env, b2| if env[:result] b2.use MessageNotCreated next end b2.use Provision end end end |
.action_read_state ⇒ Object
This action is called to read the state of the machine. The resulting state is expected to be put into the ‘:machine_state_id` key.
75 76 77 78 79 80 |
# File 'lib/vagrant-qemu/action.rb', line 75 def self.action_read_state Vagrant::Action::Builder.new.tap do |b| b.use ConfigValidate b.use ReadState end end |
.action_reload ⇒ Object
153 154 155 156 157 158 159 160 161 162 163 164 165 166 |
# File 'lib/vagrant-qemu/action.rb', line 153 def self.action_reload Vagrant::Action::Builder.new.tap do |b| b.use ConfigValidate b.use Call, IsState, :not_created do |env, b2| if env[:result] b2.use MessageNotCreated next end b2.use action_halt b2.use action_start end end end |
.action_ssh ⇒ Object
This action is called to SSH into the machine.
83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/vagrant-qemu/action.rb', line 83 def self.action_ssh Vagrant::Action::Builder.new.tap do |b| b.use ConfigValidate b.use Call, IsState, :not_created do |env, b2| if env[:result] b2.use MessageNotCreated next end b2.use SSHExec end end end |
.action_ssh_run ⇒ Object
97 98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/vagrant-qemu/action.rb', line 97 def self.action_ssh_run Vagrant::Action::Builder.new.tap do |b| b.use ConfigValidate b.use Call, IsState, :not_created do |env, b2| if env[:result] b2.use MessageNotCreated next end b2.use SSHRun end end end |
.action_start ⇒ Object
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 |
# File 'lib/vagrant-qemu/action.rb', line 111 def self.action_start Vagrant::Action::Builder.new.tap do |b| b.use Call, IsState, :running do |env1, b1| if env1[:result] b1.use action_provision next end b1.use CloudInitSetup b1.use CleanupDisks b1.use Disk b1.use Provision b1.use EnvSet, port_collision_repair: true b1.use PrepareForwardedPortCollisionParams b1.use HandleForwardedPortCollisions b1.use SyncedFolderCleanup b1.use SyncedFolders b1.use WarnNetworks b1.use SetHostname b1.use StartInstance b1.use WaitForCommunicator, [:running] b1.use MountVirtioFS end end end |
.action_up ⇒ Object
This action is called to bring the box up from nothing.
138 139 140 141 142 143 144 145 146 147 148 149 150 151 |
# File 'lib/vagrant-qemu/action.rb', line 138 def self.action_up Vagrant::Action::Builder.new.tap do |b| b.use HandleBox b.use ConfigValidate b.use BoxCheckOutdated b.use Call, IsState, :not_created do |env1, b1| if env1[:result] b1.use Import end b1.use action_start end end end |