vm_shepherd 3.6.2 → 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
  SHA1:
3
- metadata.gz: e078bebb55b78c281cc95058e277828fac2d924e
4
- data.tar.gz: 78696d4efed26e9faf0564074b4eef5045d24f26
3
+ metadata.gz: b09a65c54281ecc35d7692d7523b18b10256887c
4
+ data.tar.gz: b1f694776d98a19c90cc2b566c83f4b213e06607
5
5
  SHA512:
6
- metadata.gz: 6b5cec04dd46e3ddff775260f5a46c2c806f345e0abbc0290011ba119bdea1bf1d301cdab3d144c46c32f6130fde72952e5c24ded934dc925a53f390d117dd7e
7
- data.tar.gz: d56dd9eddd7559f576db8ce70ccee7a882fee117bb0d0a2f3e77e1e5618bb454402d58fd7309d543954a216edc071052ed8989099b0e655d3d6499e391b09703
6
+ metadata.gz: e09d8e6e66dfc6f2f4dd877684302f62b26f61eb00a8e4ea05b83c8c4c71b9e0e5f83ad2d08f3edf6db3d75fdccebefa4da00f3da2c8f126df25a1dbc9f8ce8e
7
+ data.tar.gz: 95523f5119b7a298512d471caf0a8d367e2a17bb5837b23f35bdf2f1d894e49b933b817d0f9c15525c3ac7a52aa9daad0257cb079bc2e150ded11803f076fd3e
@@ -202,7 +202,7 @@ module VmShepherd
202
202
  end
203
203
 
204
204
  def get_vsphere_vm_password(input_config)
205
- ENV['PROVISION_WITH_PASSWORD'] == 'false' ? nil : (input_config.dig('vm', 'vm_password') || 'tempest')
205
+ ENV['PROVISION_WITH_PASSWORD'] == 'false' ? nil : (input_config.dig('vm', 'vm_password') || ENV['VSPHERE_VM_PASSWORD'] || 'tempest')
206
206
  end
207
207
 
208
208
  def get_vsphere_vm_public_ssh_key(input_config)
@@ -1,3 +1,3 @@
1
1
  module VmShepherd
2
- VERSION = '3.6.2'.freeze
2
+ VERSION = '3.7.0'.freeze
3
3
  end
@@ -300,30 +300,100 @@ module VmShepherd
300
300
  context 'and it is true' do
301
301
  before { stub_const('ENV', {'PROVISION_WITH_PASSWORD' => 'true'}) }
302
302
 
303
- it 'deploys with the set vm password' do
304
- expect(first_ova_manager).to receive(:deploy).with(
305
- 'FIRST_FAKE_PATH',
306
- {
307
- ip: first_config.dig('vm', 'ip'),
308
- gateway: first_config.dig('vm', 'gateway'),
309
- netmask: first_config.dig('vm', 'netmask'),
310
- dns: first_config.dig('vm', 'dns'),
311
- ntp_servers: first_config.dig('vm', 'ntp_servers'),
312
- cpus: first_config.dig('vm', 'cpus'),
313
- ram_mb: first_config.dig('vm', 'ram_mb'),
314
- vm_password: first_config.dig('vm', 'vm_password'),
315
- public_ssh_key: 'A PUBLIC KEY',
316
- custom_hostname: first_config.dig('vm', 'custom_hostname')
317
- },
318
- {
319
- cluster: first_config.dig('vsphere', 'cluster'),
320
- resource_pool: first_config.dig('vsphere', 'resource_pool'),
321
- datastore: first_config.dig('vsphere', 'datastore'),
322
- network: first_config.dig('vsphere', 'network'),
323
- folder: first_config.dig('vsphere', 'folder'),
324
- },
325
- )
326
- manager.deploy(paths: ['FIRST_FAKE_PATH'])
303
+ context 'when the vm_password is set' do
304
+ before { stub_const('ENV', {'PROVISION_WITH_PASSWORD' => 'true', 'VSPHERE_VM_PASSWORD' => 'a-password'}) }
305
+ it 'deploys with the set vm password' do
306
+ expect(first_ova_manager).to receive(:deploy).with(
307
+ 'FIRST_FAKE_PATH',
308
+ {
309
+ ip: first_config.dig('vm', 'ip'),
310
+ gateway: first_config.dig('vm', 'gateway'),
311
+ netmask: first_config.dig('vm', 'netmask'),
312
+ dns: first_config.dig('vm', 'dns'),
313
+ ntp_servers: first_config.dig('vm', 'ntp_servers'),
314
+ cpus: first_config.dig('vm', 'cpus'),
315
+ ram_mb: first_config.dig('vm', 'ram_mb'),
316
+ vm_password: first_config.dig('vm', 'vm_password'),
317
+ public_ssh_key: 'A PUBLIC KEY',
318
+ custom_hostname: first_config.dig('vm', 'custom_hostname')
319
+ },
320
+ {
321
+ cluster: first_config.dig('vsphere', 'cluster'),
322
+ resource_pool: first_config.dig('vsphere', 'resource_pool'),
323
+ datastore: first_config.dig('vsphere', 'datastore'),
324
+ network: first_config.dig('vsphere', 'network'),
325
+ folder: first_config.dig('vsphere', 'folder'),
326
+ },
327
+ )
328
+
329
+ manager.deploy(paths: ['FIRST_FAKE_PATH'])
330
+ end
331
+ end
332
+
333
+ context 'when the ENV vsphere VM password is set' do
334
+ before do
335
+ stub_const('ENV', { 'PROVISION_WITH_PASSWORD' => 'true', 'VSPHERE_VM_PASSWORD' => 'a-password' })
336
+ first_config['vm']['vm_password'] = nil
337
+ end
338
+
339
+ it 'deploys with the ENV vm password' do
340
+ expect(first_ova_manager).to receive(:deploy).with(
341
+ 'FIRST_FAKE_PATH',
342
+ {
343
+ ip: first_config.dig('vm', 'ip'),
344
+ gateway: first_config.dig('vm', 'gateway'),
345
+ netmask: first_config.dig('vm', 'netmask'),
346
+ dns: first_config.dig('vm', 'dns'),
347
+ ntp_servers: first_config.dig('vm', 'ntp_servers'),
348
+ cpus: first_config.dig('vm', 'cpus'),
349
+ ram_mb: first_config.dig('vm', 'ram_mb'),
350
+ vm_password: 'a-password',
351
+ public_ssh_key: 'A PUBLIC KEY',
352
+ custom_hostname: first_config.dig('vm', 'custom_hostname')
353
+ },
354
+ {
355
+ cluster: first_config.dig('vsphere', 'cluster'),
356
+ resource_pool: first_config.dig('vsphere', 'resource_pool'),
357
+ datastore: first_config.dig('vsphere', 'datastore'),
358
+ network: first_config.dig('vsphere', 'network'),
359
+ folder: first_config.dig('vsphere', 'folder'),
360
+ },
361
+ )
362
+
363
+ manager.deploy(paths: ['FIRST_FAKE_PATH'])
364
+ end
365
+ end
366
+
367
+ context 'and neither vm password is set' do
368
+ before do
369
+ first_config['vm']['vm_password'] = nil
370
+ end
371
+
372
+ it 'deploys with the hardcoded vm password' do
373
+ expect(first_ova_manager).to receive(:deploy).with(
374
+ 'FIRST_FAKE_PATH',
375
+ {
376
+ ip: first_config.dig('vm', 'ip'),
377
+ gateway: first_config.dig('vm', 'gateway'),
378
+ netmask: first_config.dig('vm', 'netmask'),
379
+ dns: first_config.dig('vm', 'dns'),
380
+ ntp_servers: first_config.dig('vm', 'ntp_servers'),
381
+ cpus: first_config.dig('vm', 'cpus'),
382
+ ram_mb: first_config.dig('vm', 'ram_mb'),
383
+ vm_password: 'tempest',
384
+ public_ssh_key: 'A PUBLIC KEY',
385
+ custom_hostname: first_config.dig('vm', 'custom_hostname')
386
+ },
387
+ {
388
+ cluster: first_config.dig('vsphere', 'cluster'),
389
+ resource_pool: first_config.dig('vsphere', 'resource_pool'),
390
+ datastore: first_config.dig('vsphere', 'datastore'),
391
+ network: first_config.dig('vsphere', 'network'),
392
+ folder: first_config.dig('vsphere', 'folder'),
393
+ },
394
+ )
395
+ manager.deploy(paths: ['FIRST_FAKE_PATH'])
396
+ end
327
397
  end
328
398
  end
329
399
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vm_shepherd
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.6.2
4
+ version: 3.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ops Manager Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-28 00:00:00.000000000 Z
11
+ date: 2019-04-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-v1