Module: VagrantPlugins::HP::Action

Includes:
Vagrant::Action::Builtin
Defined in:
lib/vagrant-hp/action.rb,
lib/vagrant-hp/action/connect_hp.rb,
lib/vagrant-hp/action/is_created.rb,
lib/vagrant-hp/action/is_running.rb,
lib/vagrant-hp/action/read_state.rb,
lib/vagrant-hp/action/halt_server.rb,
lib/vagrant-hp/action/sync_folders.rb,
lib/vagrant-hp/action/create_server.rb,
lib/vagrant-hp/action/delete_server.rb,
lib/vagrant-hp/action/read_ssh_info.rb,
lib/vagrant-hp/action/warn_networks.rb,
lib/vagrant-hp/action/timed_provision.rb,
lib/vagrant-hp/action/message_not_created.rb,
lib/vagrant-hp/action/message_already_created.rb

Defined Under Namespace

Classes: ConnectHP, CreateServer, DeleteServer, HaltServer, IsCreated, IsRunning, MessageAlreadyCreated, MessageNotCreated, ReadSSHInfo, ReadState, SyncFolders, TimedProvision, WarnNetworks

Class Method Summary collapse

Class Method Details

.action_destroyObject

This action is called to terminate the remote machine.



16
17
18
19
20
21
22
# File 'lib/vagrant-hp/action.rb', line 16

def self.action_destroy
  Vagrant::Action::Builder.new.tap do |b|
    b.use ConfigValidate
    b.use ConnectHP
    b.use DeleteServer
  end
end

.action_provisionObject

This action is called when ‘vagrant provision` is called.



25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/vagrant-hp/action.rb', line 25

def self.action_provision
  Vagrant::Action::Builder.new.tap do |b|
    b.use ConfigValidate
    b.use Call, IsCreated do |env, b2|
      unless env[:result]
        b2.use MessageNotCreated
        next
      end
      b2.use Provision
      b2.use SyncFolders
    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.



42
43
44
45
46
47
48
# File 'lib/vagrant-hp/action.rb', line 42

def self.action_read_ssh_info
  Vagrant::Action::Builder.new.tap do |b|
    b.use ConfigValidate
    b.use ConnectHP
    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.



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

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

.action_sshObject

This action is called to SSH into the machine.



62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/vagrant-hp/action.rb', line 62

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

      b2.use SSHExec
    end
  end
end

.action_upObject



76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/vagrant-hp/action.rb', line 76

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

      b2.use ConnectHP
      b2.use Provision
      b2.use SyncFolders
      b2.use WarnNetworks
      b2.use CreateServer
    end
  end
end