Module: VagrantPlugins::GANETI::Action
- Includes:
- Vagrant::Action::Builtin
- Defined in:
- lib/vagrant-ganeti/action.rb,
lib/vagrant-ganeti/action/is_created.rb,
lib/vagrant-ganeti/action/read_state.rb,
lib/vagrant-ganeti/action/is_reachable.rb,
lib/vagrant-ganeti/action/run_instance.rb,
lib/vagrant-ganeti/action/sync_folders.rb,
lib/vagrant-ganeti/action/read_ssh_info.rb,
lib/vagrant-ganeti/action/unlink_server.rb,
lib/vagrant-ganeti/action/warn_networks.rb,
lib/vagrant-ganeti/action/connect_ganeti.rb,
lib/vagrant-ganeti/action/remove_instance.rb,
lib/vagrant-ganeti/action/timed_provision.rb,
lib/vagrant-ganeti/action/message_not_created.rb,
lib/vagrant-ganeti/action/message_not_reachable.rb,
lib/vagrant-ganeti/action/message_already_created.rb,
lib/vagrant-ganeti/action/message_will_not_destroy.rb
Defined Under Namespace
Classes: ConnectGANETI, IsCreated, IsReachable, MessageAlreadyCreated, MessageNotCreated, MessageNotReachable, MessageWillNotDestroy, ReadSSHInfo, ReadState, RemoveInstance, RunInstance, SyncFolders, TimedProvision, UnlinkServer, WarnNetworks
Class Method Summary collapse
- .action_destroy ⇒ Object
-
.action_provision ⇒ Object
This action is called when ‘vagrant provision` is called.
-
.action_read_ssh_info ⇒ Object
This action is called to read the SSH info of the machine.
-
.action_read_state ⇒ Object
This action is called to read the state of the machine.
-
.action_ssh ⇒ Object
This action is called to SSH into the machine.
- .action_ssh_run ⇒ Object
-
.action_up ⇒ Object
This action is called to establish linkage between vagrant and the Ganeti.
Class Method Details
.action_destroy ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/vagrant-ganeti/action.rb', line 39 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 ConnectGANETI b2.use RemoveInstance else b2.use MessageWillNotDestroy end end end end |
.action_provision ⇒ Object
This action is called when ‘vagrant provision` is called.
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/vagrant-ganeti/action.rb', line 54 def self.action_provision Vagrant::Action::Builder.new.tap do |b| b.use ConfigValidate b.use WarnNetworks b.use Call, IsCreated do |env, b2| if !env[:result] b2.use MessageNotReachable next end b2.use Provision b2.use SyncFolders end end end |
.action_read_ssh_info ⇒ Object
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.
99 100 101 102 103 104 105 |
# File 'lib/vagrant-ganeti/action.rb', line 99 def self.action_read_ssh_info Vagrant::Action::Builder.new.tap do |b| b.use ConfigValidate # b.use ConnectGANETI b.use ReadSSHInfo 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.
73 74 75 76 77 78 |
# File 'lib/vagrant-ganeti/action.rb', line 73 def self.action_read_state Vagrant::Action::Builder.new.tap do |b| b.use ConfigValidate b.use ReadState end end |
.action_ssh ⇒ Object
This action is called to SSH into the machine.
81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/vagrant-ganeti/action.rb', line 81 def self.action_ssh Vagrant::Action::Builder.new.tap do |b| b.use ConfigValidate b.use WarnNetworks b.use Call, IsCreated do |env, b2| if !env[:result] b2.use MessageNotReachable next end b2.use SSHExec end end end |
.action_ssh_run ⇒ Object
107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/vagrant-ganeti/action.rb', line 107 def self.action_ssh_run Vagrant::Action::Builder.new.tap do |b| b.use ConfigValidate b.use WarnNetworks b.use Call, IsCreated do |env, b2| if !env[:result] b2.use MessageNotReachable next end b2.use SSHRun end end end |
.action_up ⇒ Object
This action is called to establish linkage between vagrant and the Ganeti
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/vagrant-ganeti/action.rb', line 12 def self.action_up Vagrant::Action::Builder.new.tap do |b| b.use HandleBoxUrl b.use ConfigValidate b.use WarnNetworks b.use ConnectGANETI b.use RunInstance #b.use LinkServer =begin b.use HandleBoxUrl b.use ConfigValidate b.use Call, IsReachable do |env, b2| if env[:result] b2.use !MessageNotReachable next end b2.use Provision b2.use SyncFolders b2.use WarnNetworks b2.use LinkServer end =end end end |