Module: VagrantPlugins::VSphere::Action
- Includes:
- Vagrant::Action::Builtin
- Defined in:
- lib/vSphere/action.rb,
lib/vSphere/action/clone.rb,
lib/vSphere/action/destroy.rb,
lib/vSphere/action/power_on.rb,
lib/vSphere/action/get_state.rb,
lib/vSphere/action/power_off.rb,
lib/vSphere/action/is_created.rb,
lib/vSphere/action/is_running.rb,
lib/vSphere/action/get_ssh_info.rb,
lib/vSphere/action/sync_folders.rb,
lib/vSphere/action/close_vsphere.rb,
lib/vSphere/action/connect_vsphere.rb,
lib/vSphere/action/message_not_created.rb,
lib/vSphere/action/message_not_running.rb,
lib/vSphere/action/message_already_created.rb
Defined Under Namespace
Classes: Clone, CloseVSphere, ConnectVSphere, Destroy, GetSshInfo, GetState, IsCreated, IsRunning, MessageAlreadyCreated, MessageNotRunning, PowerOff, PowerOn, SyncFolders
Class Method Summary
collapse
Class Method Details
.action_destroy ⇒ Object
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/vSphere/action.rb', line 10
def self.action_destroy
Vagrant::Action::Builder.new.tap do |b|
b.use ConfigValidate
b.use ConnectVSphere
b.use Call, IsRunning do |env, b2|
if [:result]
b2.use PowerOff
next
end
end
b.use Destroy
end
end
|
.action_get_ssh_info ⇒ Object
144
145
146
147
148
149
150
151
|
# File 'lib/vSphere/action.rb', line 144
def self.action_get_ssh_info
Vagrant::Action::Builder.new.tap do |b|
b.use ConfigValidate
b.use ConnectVSphere
b.use GetSshInfo
b.use CloseVSphere
end
end
|
.action_get_state ⇒ Object
135
136
137
138
139
140
141
142
|
# File 'lib/vSphere/action.rb', line 135
def self.action_get_state
Vagrant::Action::Builder.new.tap do |b|
b.use ConfigValidate
b.use ConnectVSphere
b.use GetState
b.use CloseVSphere
end
end
|
.action_halt ⇒ Object
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
|
# File 'lib/vSphere/action.rb', line 111
def self.action_halt
Vagrant::Action::Builder.new.tap do |b|
b.use ConfigValidate
b.use ConnectVSphere
b.use Call, IsCreated do |env, b2|
if !env[:result]
b2.use MessageNotCreated
next
end
b2.use Call, IsRunning do |env, b3|
if !env[:result]
b3.use MessageNotRunning
next
end
b3.use PowerOff
end
end
b.use CloseVSphere
end
end
|
.action_provision ⇒ Object
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
# File 'lib/vSphere/action.rb', line 24
def self.action_provision
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 Call, IsRunning do |env, b3|
if !env[:result]
b3.use MessageNotRunning
next
end
b3.use Provision
b3.use SyncFolders
end
end
end
end
|
.action_ssh ⇒ Object
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
# File 'lib/vSphere/action.rb', line 46
def self.action_ssh
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 Call, IsRunning do |env, b3|
if !env[:result]
b3.use MessageNotRunning
next
end
b3.use SSHExec
end
end
end
end
|
.action_ssh_run ⇒ Object
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
# File 'lib/vSphere/action.rb', line 67
def self.action_ssh_run
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 Call, IsRunning do |env, b3|
if !env[:result]
b3.use MessageNotRunning
next
end
b3.use SSHRun
end
end
end
end
|
.action_up ⇒ Object
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
|
# File 'lib/vSphere/action.rb', line 88
def self.action_up
Vagrant::Action::Builder.new.tap do |b|
b.use ConfigValidate
b.use ConnectVSphere
b.use Call, IsCreated do |env, b2|
if env[:result]
b2.use MessageAlreadyCreated
next
end
b2.use Clone
end
b.use Call, IsRunning do |env, b2|
if !env[:result]
b2.use PowerOn
end
end
b.use CloseVSphere
b.use Provision
b.use SyncFolders
end
end
|