fog-vsphere 3.6.6 → 3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 819e41def6f26e5e5c0b8da2e15fbd84afd9d4ff2d32b566fd67edc616e5d765
4
- data.tar.gz: 305ceccf0f1718b079d7082723b0d760ff3738033e4f1492719be75d301f96ea
3
+ metadata.gz: c2d12d766e82a1faadbe212c6bd4b456f2f5d8b5020eea068e3baf03bfed784a
4
+ data.tar.gz: 9c83dbf3aedac89dd590e6ca916aa88a66c8bf3fe3340e94c9e42de919c9cb98
5
5
  SHA512:
6
- metadata.gz: 979f8ff4d77c5dd92bbe2f404308c4100db6f5d59ba8ea0ac382b4e578e8ee775c5eb5d1355ebe43b035537aaf295e55dfb7a1a5e58da58cefc6a05d4ebe3eb4
7
- data.tar.gz: 81742888f852d0d898d0d61105552eca3380d23af4da0b8600c142976311eba0735fdfb13eef9326e79ffcaf26b87e5a9b338bb7f65f4e6791d81d29676f5643
6
+ metadata.gz: a7c125bd12412bf05a7bb3941bf911f84b3fffd5a75e029b4af16173551c8059c1ac2325fc75eded98705f284a82116616473ff49c86f0b56eb98131a2ada32a
7
+ data.tar.gz: 83783358165788fa50e94953c1946f0ab86abb3d0d93bbca2d91932abbb1be003e5b6ad2ba8f74aa2108bbbf23d8da70664c74cc06578c04b4351687b4fb3b22
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'codeclimate-test-reporter', group: :test, require: nil
4
+
5
+ gemspec
@@ -0,0 +1,40 @@
1
+
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'fog/vsphere/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'fog-vsphere'
8
+ spec.version = Fog::Vsphere::VERSION
9
+ spec.authors = ['J.R. Garcia']
10
+ spec.email = ['jr@garciaole.com']
11
+
12
+ spec.summary = "Module for the 'fog' gem to support VMware vSphere."
13
+ spec.description = 'This library can be used as a module for `fog` or as standalone provider to use vSphere in applications.'
14
+ spec.homepage = 'https://github.com/fog/fog-vsphere'
15
+ spec.license = 'MIT'
16
+
17
+ spec.files = Dir['lib/**/*'] +
18
+ ['LICENSE.md', 'Rakefile', 'README.md', 'CHANGELOG.md', 'CONTRIBUTORS.md', 'Gemfile', 'fog-vsphere.gemspec']
19
+ spec.test_files = Dir['tests/**/*']
20
+
21
+ spec.require_paths = ['lib']
22
+
23
+ spec.required_ruby_version = '>= 2.7'
24
+
25
+ spec.add_runtime_dependency 'fog-core'
26
+ spec.add_runtime_dependency 'rbvmomi2', '~> 3.0'
27
+
28
+ spec.add_development_dependency 'bundler'
29
+ spec.add_development_dependency 'pry', '~> 0.10'
30
+ spec.add_development_dependency 'rake', '>= 12.3.3'
31
+ spec.add_development_dependency 'minitest', '~> 5.22'
32
+ spec.add_development_dependency 'rubocop', '~> 1.39.0'
33
+ spec.add_development_dependency 'rubocop-minitest'
34
+ spec.add_development_dependency 'rubocop-performance'
35
+ spec.add_development_dependency 'rubocop-rake'
36
+ spec.add_development_dependency 'mocha', '~> 2.2'
37
+ spec.add_development_dependency 'shindo', '~> 0.3'
38
+ spec.add_development_dependency 'webmock', '~> 3.5'
39
+ spec.add_development_dependency 'vcr', '~> 6.0'
40
+ end
@@ -156,6 +156,7 @@ module Fog
156
156
  parent: 'parent',
157
157
  hostname: 'summary.guest.hostName',
158
158
  operatingsystem: 'summary.guest.guestFullName',
159
+ virtual_tpm: 'summary.config.tpmPresent',
159
160
  ipaddress: 'guest.ipAddress',
160
161
  power_state: 'runtime.powerState',
161
162
  connection_state: 'runtime.connectionState',
@@ -173,6 +174,7 @@ module Fog
173
174
  cpuHotAddEnabled: 'config.cpuHotAddEnabled',
174
175
  memoryHotAddEnabled: 'config.memoryHotAddEnabled',
175
176
  firmware: 'config.firmware',
177
+ secure_boot: 'config.bootOptions.efiSecureBootEnabled',
176
178
  boot_order: 'config.bootOptions.bootOrder',
177
179
  annotation: 'config.annotation',
178
180
  extra_config: 'config.extraConfig'
@@ -53,6 +53,8 @@ module Fog
53
53
  attribute :cpuHotAddEnabled
54
54
  attribute :memoryHotAddEnabled
55
55
  attribute :firmware
56
+ attribute :secure_boot
57
+ attribute :virtual_tpm
56
58
  attribute :boot_order
57
59
  attribute :annotation
58
60
  attribute :extra_config
@@ -1,6 +1,7 @@
1
1
  module Fog
2
2
  module Vsphere
3
3
  class Compute
4
+ # rubocop:disable Metrics/ClassLength
4
5
  class Real
5
6
  def create_vm(attributes = {})
6
7
  # build up vm configuration
@@ -22,7 +23,7 @@ module Fog
22
23
  vm_cfg[:cpuHotAddEnabled] = attributes[:cpuHotAddEnabled] if attributes.key?(:cpuHotAddEnabled)
23
24
  vm_cfg[:memoryHotAddEnabled] = attributes[:memoryHotAddEnabled] if attributes.key?(:memoryHotAddEnabled)
24
25
  vm_cfg[:firmware] = attributes[:firmware] if attributes.key?(:firmware)
25
- vm_cfg[:bootOptions] = boot_options(attributes, vm_cfg) if attributes.key?(:boot_order) || attributes.key?(:boot_retry)
26
+ vm_cfg[:bootOptions] = boot_options(attributes, vm_cfg)
26
27
  resource_pool = if attributes[:resource_pool] && attributes[:resource_pool] != 'Resources'
27
28
  get_raw_resource_pool(attributes[:resource_pool], attributes[:cluster], attributes[:datacenter])
28
29
  else
@@ -153,6 +154,9 @@ module Fog
153
154
  if (cdroms = attributes[:cdroms])
154
155
  devices << cdroms.map { |cdrom| create_cdrom(cdrom, cdroms.index(cdrom)) }
155
156
  end
157
+
158
+ devices << create_virtual_tpm if attributes[:virtual_tpm]
159
+
156
160
  devices.flatten
157
161
  end
158
162
 
@@ -170,6 +174,8 @@ module Fog
170
174
  options[:bootRetryDelay] = attributes[:boot_retry]
171
175
  end
172
176
 
177
+ options[:efiSecureBootEnabled] = attributes[:secure_boot] if attributes.key?(:secure_boot)
178
+
173
179
  options.empty? ? nil : RbVmomi::VIM::VirtualMachineBootOptions.new(options)
174
180
  end
175
181
 
@@ -333,12 +339,20 @@ module Fog
333
339
  }
334
340
  end
335
341
 
342
+ def create_virtual_tpm
343
+ {
344
+ operation: :add,
345
+ device: RbVmomi::VIM::VirtualTPM.new(key: -1)
346
+ }
347
+ end
348
+
336
349
  def extra_config(attributes)
337
350
  extra_config = attributes[:extra_config] || { 'bios.bootOrder' => 'ethernet0' }
338
351
  extra_config.map { |k, v| { key: k, value: v.to_s } }
339
352
  end
340
353
  end
341
354
 
355
+ # rubocop:enable Metrics/ClassLength
342
356
  class Mock
343
357
  def create_vm(attributes = {})
344
358
  id = SecureRandom.uuid
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module Vsphere
3
- VERSION = '3.6.6'.freeze
3
+ VERSION = '3.7.0'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fog-vsphere
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.6.6
4
+ version: 3.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - J.R. Garcia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-11 00:00:00.000000000 Z
11
+ date: 2024-07-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fog-core
@@ -216,9 +216,11 @@ extra_rdoc_files: []
216
216
  files:
217
217
  - CHANGELOG.md
218
218
  - CONTRIBUTORS.md
219
+ - Gemfile
219
220
  - LICENSE.md
220
221
  - README.md
221
222
  - Rakefile
223
+ - fog-vsphere.gemspec
222
224
  - lib/fog-vsphere.rb
223
225
  - lib/fog/bin/vsphere.rb
224
226
  - lib/fog/vsphere.rb