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/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, MessageNotCreated, MessageNotRunning, PowerOff, PowerOn
Class Method Summary
collapse
Class Method Details
.action_destroy ⇒ Object
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# 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 env[:result]
if env[:force_confirm_destroy]
b2.use PowerOff
next
end
b2.use Call, GracefulHalt, :poweroff, :running do |env2, b3|
b3.use PowerOff unless env2[:result]
end
end
end
b.use Destroy
end
end
|
.action_get_ssh_info ⇒ Object
168
169
170
171
172
173
174
175
|
# File 'lib/vSphere/action.rb', line 168
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
158
159
160
161
162
163
164
165
166
|
# File 'lib/vSphere/action.rb', line 158
def self.action_get_state
Vagrant::Action::Builder.new.tap do |b|
b.use HandleBox
b.use ConfigValidate
b.use ConnectVSphere
b.use GetState
b.use CloseVSphere
end
end
|
.action_halt ⇒ Object
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
|
# File 'lib/vSphere/action.rb', line 118
def self.action_halt
Vagrant::Action::Builder.new.tap do |b|
b.use ConfigValidate
b.use ConnectVSphere
b.use Call, IsCreated do |env, b2|
unless env[:result]
b2.use MessageNotCreated
next
end
b2.use Call, IsRunning do |env2, b3|
unless env2[:result]
b3.use MessageNotRunning
next
end
b3.use Call, GracefulHalt, :poweroff, :running do |env3, b4|
b4.use PowerOff unless env3[:result]
end
end
end
b.use CloseVSphere
end
end
|
.action_provision ⇒ Object
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
# File 'lib/vSphere/action.rb', line 31
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 Call, IsRunning do |env2, b3|
unless env2[:result]
b3.use MessageNotRunning
next
end
b3.use Provision
b3.use SyncedFolders
end
end
end
end
|
.action_reload ⇒ Object
143
144
145
146
147
148
149
150
151
152
153
154
155
|
# File 'lib/vSphere/action.rb', line 143
def self.action_reload
Vagrant::Action::Builder.new.tap do |b|
b.use ConnectVSphere
b.use Call, IsCreated do |env, b2|
unless env[:result]
b2.use MessageNotCreated
next
end
b2.use action_halt
b2.use action_up
end
end
end
|
.action_ssh ⇒ Object
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
# File 'lib/vSphere/action.rb', line 53
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 Call, IsRunning do |env2, b3|
unless env2[:result]
b3.use MessageNotRunning
next
end
b3.use SSHExec
end
end
end
end
|
.action_ssh_run ⇒ Object
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
|
# File 'lib/vSphere/action.rb', line 74
def self.action_ssh_run
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 Call, IsRunning do |env2, b3|
unless env2[:result]
b3.use MessageNotRunning
next
end
b3.use SSHRun
end
end
end
end
|
.action_up ⇒ Object
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
|
# File 'lib/vSphere/action.rb', line 95
def self.action_up
Vagrant::Action::Builder.new.tap do |b|
b.use HandleBox
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|
b2.use PowerOn unless env[:result]
end
b.use CloseVSphere
b.use Provision
b.use SyncedFolders
b.use SetHostname
end
end
|