chef-provisioning-vsphere 0.5.1 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9429c5a2889eb0b8c3a74c2aa968e6134d6933df
|
4
|
+
data.tar.gz: e48b0fe64f042425825347c5408fbf33bcdd7fea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7daa42c1d264122430a212d5b2433f8ebc2e67b2e043853af254d8f9d3d6489d14d3ecb9d5b0303ce99bb6c260c2d29168e9ebd06661f7ec474f9e5b992d576b
|
7
|
+
data.tar.gz: bfffe594fc7914b88753a64f2bf527d6877fbe2e7ea92c100c91368c05523f80c5f69e8013a7a20b7e85920cb7549c678229ead358dab5185b8255b2a79cef77
|
@@ -110,6 +110,8 @@ module ChefProvisioningVsphere
|
|
110
110
|
# -- vm_folder: name of the vSphere folder containing the VM
|
111
111
|
#
|
112
112
|
def allocate_machine(action_handler, machine_spec, machine_options)
|
113
|
+
merge_options! machine_options
|
114
|
+
|
113
115
|
if machine_spec.location
|
114
116
|
Chef::Log.warn(
|
115
117
|
"Checking to see if #{machine_spec.location} has been created...")
|
@@ -142,6 +144,13 @@ module ChefProvisioningVsphere
|
|
142
144
|
vm
|
143
145
|
end
|
144
146
|
|
147
|
+
def merge_options!(machine_options)
|
148
|
+
@config = Cheffish::MergedConfig.new(
|
149
|
+
{ machine_options: machine_options },
|
150
|
+
@config
|
151
|
+
)
|
152
|
+
end
|
153
|
+
|
145
154
|
def add_machine_spec_location(vm, machine_spec)
|
146
155
|
machine_spec.location = {
|
147
156
|
'driver_url' => driver_url,
|
@@ -188,6 +197,8 @@ module ChefProvisioningVsphere
|
|
188
197
|
end
|
189
198
|
|
190
199
|
def ready_machine(action_handler, machine_spec, machine_options)
|
200
|
+
merge_options! machine_options
|
201
|
+
|
191
202
|
vm = start_machine(action_handler, machine_spec, machine_options)
|
192
203
|
if vm.nil?
|
193
204
|
raise "Machine #{machine_spec.name} does not have a server "\
|
@@ -350,10 +361,12 @@ module ChefProvisioningVsphere
|
|
350
361
|
|
351
362
|
# Connect to machine without acquiring it
|
352
363
|
def connect_to_machine(machine_spec, machine_options)
|
364
|
+
merge_options! machine_options
|
353
365
|
machine_for(machine_spec, machine_options)
|
354
366
|
end
|
355
367
|
|
356
368
|
def destroy_machine(action_handler, machine_spec, machine_options)
|
369
|
+
merge_options! machine_options
|
357
370
|
vm = vm_for(machine_spec)
|
358
371
|
if vm
|
359
372
|
action_handler.perform_action "Delete VM [#{vm.parent.name}/#{vm.name}]" do
|
@@ -372,6 +385,7 @@ module ChefProvisioningVsphere
|
|
372
385
|
end
|
373
386
|
|
374
387
|
def stop_machine(action_handler, machine_spec, machine_options)
|
388
|
+
merge_options! machine_options
|
375
389
|
vm = vm_for(machine_spec)
|
376
390
|
if vm
|
377
391
|
action_handler.perform_action "Shutdown guest OS and power off VM [#{vm.parent.name}/#{vm.name}]" do
|
@@ -381,6 +395,7 @@ module ChefProvisioningVsphere
|
|
381
395
|
end
|
382
396
|
|
383
397
|
def start_machine(action_handler, machine_spec, machine_options)
|
398
|
+
merge_options! machine_options
|
384
399
|
vm = vm_for(machine_spec)
|
385
400
|
if vm
|
386
401
|
action_handler.perform_action "Power on VM [#{vm.parent.name}/#{vm.name}]" do
|
@@ -519,15 +534,21 @@ module ChefProvisioningVsphere
|
|
519
534
|
require 'chef/provisioning/convergence_strategy/install_msi'
|
520
535
|
require 'chef/provisioning/convergence_strategy/install_cached'
|
521
536
|
require 'chef/provisioning/convergence_strategy/no_converge'
|
522
|
-
|
537
|
+
|
538
|
+
mopts = machine_options[:convergence_options].to_hash.dup
|
539
|
+
mopts[:chef_server] = mopts[:chef_server].to_hash.dup if mopts[:chef_server]
|
540
|
+
|
523
541
|
if !machine_spec.location
|
524
|
-
return Chef::Provisioning::ConvergenceStrategy::NoConverge.new(
|
542
|
+
return Chef::Provisioning::ConvergenceStrategy::NoConverge.new(
|
543
|
+
mopts, config)
|
525
544
|
end
|
526
545
|
|
527
546
|
if machine_spec.location['is_windows']
|
528
|
-
Chef::Provisioning::ConvergenceStrategy::InstallMsi.new(
|
547
|
+
Chef::Provisioning::ConvergenceStrategy::InstallMsi.new(
|
548
|
+
mopts, config)
|
529
549
|
else
|
530
|
-
Chef::Provisioning::ConvergenceStrategy::InstallCached.new(
|
550
|
+
Chef::Provisioning::ConvergenceStrategy::InstallCached.new(
|
551
|
+
mopts, config)
|
531
552
|
end
|
532
553
|
end
|
533
554
|
|
@@ -74,12 +74,12 @@ module Kitchen
|
|
74
74
|
chef_server = Cheffish.default_chef_server
|
75
75
|
config[:machine_options][:convergence_options] = {:chef_server => chef_server}
|
76
76
|
machine_spec = Chef::Provisioning.chef_managed_entry_store(chef_server).new_entry(:machine, name)
|
77
|
-
|
77
|
+
url = URI::VsphereUrl.from_config(@config[:driver_options]).to_s
|
78
|
+
driver = Chef::Provisioning.driver_for_url(url, config)
|
78
79
|
action_handler = Chef::Provisioning::ActionHandler.new
|
79
80
|
block.call(action_handler, driver, machine_spec)
|
80
81
|
end
|
81
82
|
end
|
82
|
-
|
83
83
|
end
|
84
84
|
end
|
85
85
|
end
|