kitchen-vcenter 2.6.5 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/kitchen-vcenter/version.rb +1 -1
- data/lib/kitchen/driver/vcenter.rb +5 -0
- data/lib/support/clone_vm.rb +13 -2
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: da86b6422044114b6f2b89cc85b8dc527fa5b743f2ff733e604c4730773e6fae
|
|
4
|
+
data.tar.gz: dab5b088008e3344b2d52fca17d97a4fffaf25a4dbf486b4ac7139d82bedbf00
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7fe27912e489acea7d4d126ca4ff6db750d24dbb56024ff387816db7b2948522da203a1d01cb728a7f16b10b0e44fb0bd27bfefa54a93849328fde67fe939d07
|
|
7
|
+
data.tar.gz: daadea97931ae326c43ab040ccd3cd5ebea0d724f76a8c9e3cc86b5e16c2f47b519fb7e66859f3db106b5366f05fd20d6ee5e373ef29d5098756d58845a9d1ee
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
require "kitchen"
|
|
19
19
|
require "vsphere-automation-cis"
|
|
20
20
|
require "vsphere-automation-vcenter"
|
|
21
|
+
require_relative "../../kitchen-vcenter/version"
|
|
21
22
|
require_relative "../../support/clone_vm"
|
|
22
23
|
require "securerandom"
|
|
23
24
|
require "uri"
|
|
@@ -57,6 +58,7 @@ module Kitchen
|
|
|
57
58
|
default_config :vm_username, "vagrant"
|
|
58
59
|
default_config :vm_password, "vagrant"
|
|
59
60
|
default_config :vm_win_network, "Ethernet0"
|
|
61
|
+
default_config :transform_ip, nil
|
|
60
62
|
|
|
61
63
|
default_config :benchmark, false
|
|
62
64
|
default_config :benchmark_file, "kitchen-vcenter.csv"
|
|
@@ -82,6 +84,8 @@ module Kitchen
|
|
|
82
84
|
#
|
|
83
85
|
# @param [Object] state is the state of the vm
|
|
84
86
|
def create(state)
|
|
87
|
+
debug format("Starting kitchen-vcenter %s", ::KitchenVcenter::VERSION)
|
|
88
|
+
|
|
85
89
|
save_and_validate_parameters
|
|
86
90
|
connect
|
|
87
91
|
|
|
@@ -158,6 +162,7 @@ module Kitchen
|
|
|
158
162
|
vm_username: config[:vm_username],
|
|
159
163
|
vm_password: config[:vm_password],
|
|
160
164
|
vm_win_network: config[:vm_win_network],
|
|
165
|
+
transform_ip: config[:transform_ip],
|
|
161
166
|
benchmark: config[:benchmark],
|
|
162
167
|
benchmark_file: config[:benchmark_file],
|
|
163
168
|
}
|
data/lib/support/clone_vm.rb
CHANGED
|
@@ -81,6 +81,17 @@ class Support
|
|
|
81
81
|
raise Support::CloneError.new("Timeout waiting for IP address") if ip.nil?
|
|
82
82
|
raise Support::CloneError.new(format("Error getting accessible IP address, got %s. Check DHCP server and scope exhaustion", ip)) if ip =~ /^169\.254\./
|
|
83
83
|
|
|
84
|
+
# Allow IP rewriting (e.g. for 1:1 NAT)
|
|
85
|
+
if options[:transform_ip]
|
|
86
|
+
Kitchen.logger.info format("Received IP: %s", ip)
|
|
87
|
+
|
|
88
|
+
# rubocop:disable Security/Eval
|
|
89
|
+
ip = lambda { eval options[:transform_ip] }.call
|
|
90
|
+
# rubocop:enable Security/Eval
|
|
91
|
+
|
|
92
|
+
Kitchen.logger.info format("Transformed to IP: %s", ip)
|
|
93
|
+
end
|
|
94
|
+
|
|
84
95
|
@ip = ip
|
|
85
96
|
end
|
|
86
97
|
|
|
@@ -251,8 +262,8 @@ class Support
|
|
|
251
262
|
# "wmic nicconfig get IPAddress",
|
|
252
263
|
# "netsh interface ip show ipaddress #{options[:vm_win_network]}"
|
|
253
264
|
end
|
|
254
|
-
else
|
|
255
|
-
|
|
265
|
+
else
|
|
266
|
+
options[:active_discovery_command]
|
|
256
267
|
end
|
|
257
268
|
end
|
|
258
269
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: kitchen-vcenter
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.7.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Chef Software
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-
|
|
11
|
+
date: 2020-04-14 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rbvmomi
|