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 +4 -4
- data/lib/vm_shepherd/shepherd.rb +1 -1
- data/lib/vm_shepherd/version.rb +1 -1
- data/spec/vm_shepherd/shepherd_spec.rb +94 -24
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b09a65c54281ecc35d7692d7523b18b10256887c
|
4
|
+
data.tar.gz: b1f694776d98a19c90cc2b566c83f4b213e06607
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e09d8e6e66dfc6f2f4dd877684302f62b26f61eb00a8e4ea05b83c8c4c71b9e0e5f83ad2d08f3edf6db3d75fdccebefa4da00f3da2c8f126df25a1dbc9f8ce8e
|
7
|
+
data.tar.gz: 95523f5119b7a298512d471caf0a8d367e2a17bb5837b23f35bdf2f1d894e49b933b817d0f9c15525c3ac7a52aa9daad0257cb079bc2e150ded11803f076fd3e
|
data/lib/vm_shepherd/shepherd.rb
CHANGED
@@ -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)
|
data/lib/vm_shepherd/version.rb
CHANGED
@@ -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
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
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.
|
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-
|
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
|