Module: VagrantPlugins::OVirtProvider::Action

Includes:
Vagrant::Action::Builtin
Defined in:
lib/vagrant-ovirt/action.rb,
lib/vagrant-ovirt/action/start_vm.rb,
lib/vagrant-ovirt/action/create_vm.rb,
lib/vagrant-ovirt/action/destroy_vm.rb,
lib/vagrant-ovirt/action/is_created.rb,
lib/vagrant-ovirt/action/read_state.rb,
lib/vagrant-ovirt/action/sync_folders.rb,
lib/vagrant-ovirt/action/wait_till_up.rb,
lib/vagrant-ovirt/action/connect_ovirt.rb,
lib/vagrant-ovirt/action/read_ssh_info.rb,
lib/vagrant-ovirt/action/timed_provision.rb,
lib/vagrant-ovirt/action/set_name_of_domain.rb,
lib/vagrant-ovirt/action/message_not_created.rb,
lib/vagrant-ovirt/action/message_already_created.rb,
lib/vagrant-ovirt/action/create_network_interfaces.rb

Defined Under Namespace

Classes: ConnectOVirt, CreateNetworkInterfaces, CreateVM, DestroyVM, IsCreated, MessageAlreadyCreated, MessageNotCreated, ReadSSHInfo, ReadState, SetNameOfDomain, StartVM, SyncFolders, TimedProvision, WaitTillUp

Class Method Summary collapse

Class Method Details

.action_destroyObject

This is the action that is primarily responsible for completely freeing the resources of the underlying virtual machine.



35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/vagrant-ovirt/action.rb', line 35

def self.action_destroy
  Vagrant::Action::Builder.new.tap do |b|
    b.use ConfigValidate
    b.use Call, IsCreated do |env, b2|
      if !env[:result]
        b2.use MessageNotCreated
        next
      end

      b2.use ConnectOVirt
      b2.use DestroyVM
    end
  end
end

.action_read_ssh_infoObject

This action is called to read the SSH info of the machine. The resulting state is expected to be put into the ‘:machine_ssh_info` key.



63
64
65
66
67
68
69
# File 'lib/vagrant-ovirt/action.rb', line 63

def self.action_read_ssh_info
  Vagrant::Action::Builder.new.tap do |b|
    b.use ConfigValidate
    b.use ConnectOVirt
    b.use ReadSSHInfo
  end
end

.action_read_stateObject

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.



52
53
54
55
56
57
58
# File 'lib/vagrant-ovirt/action.rb', line 52

def self.action_read_state
  Vagrant::Action::Builder.new.tap do |b|
    b.use ConfigValidate
    b.use ConnectOVirt
    b.use ReadState
  end
end

.action_upObject

This action is called to bring the box up from nothing.



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/vagrant-ovirt/action.rb', line 10

def self.action_up
  Vagrant::Action::Builder.new.tap do |b|
    b.use ConfigValidate
    b.use ConnectOVirt
    b.use Call, IsCreated do |env, b2|
      if env[:result]
        b2.use MessageAlreadyCreated
        next
      end

      # Create and start VM if not yet created.
      b2.use SetNameOfDomain
      b2.use CreateVM
      b2.use CreateNetworkInterfaces

      b2.use TimedProvision
      b2.use StartVM
      b2.use WaitTillUp
      b2.use SyncFolders
    end
  end
end