vm_shepherd 1.3.2 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vm_shepherd/aws_manager.rb +1 -2
- data/lib/vm_shepherd/shepherd.rb +1 -0
- data/lib/vm_shepherd/version.rb +1 -1
- data/spec/fixtures/shepherd/aws-no-elb.yml +1 -0
- data/spec/fixtures/shepherd/aws.yml +1 -0
- data/spec/vm_shepherd/aws_manager_spec.rb +2 -1
- data/spec/vm_shepherd/shepherd_spec.rb +9 -76
- 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: dbd68ca7cd87040a4ab49f591a0d2b16331051c9
|
4
|
+
data.tar.gz: 5ceaa7fabf7637124880840b74e3bf27f3d9fb28
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef7f38a5e4751e80910e01a4848f3ec49d536c47023bba2984696fdadc008e317dac2d8e5f7e8043e116aa6008a4fbd15e55b5c5dba3a909a2d49338d68209fc
|
7
|
+
data.tar.gz: 7d240aa912d76813f3621b994c63fff6bae93336c17a4999156b5b4cfd018e11ecd5670b07490adc5efdd0a8865437858c765c50edd31bc5d46068995950558d
|
@@ -5,7 +5,6 @@ module VmShepherd
|
|
5
5
|
class AwsManager
|
6
6
|
include VmShepherd::RetryHelper
|
7
7
|
|
8
|
-
AWS_REGION = 'us-east-1'
|
9
8
|
OPS_MANAGER_INSTANCE_TYPE = 'm3.medium'
|
10
9
|
DO_NOT_TERMINATE_TAG_KEY = 'do_not_terminate'
|
11
10
|
ELB_SECURITY_GROUP_NAME = 'ELB Security Group'
|
@@ -14,7 +13,7 @@ module VmShepherd
|
|
14
13
|
AWS.config(
|
15
14
|
access_key_id: env_config.fetch(:aws_access_key),
|
16
15
|
secret_access_key: env_config.fetch(:aws_secret_key),
|
17
|
-
region:
|
16
|
+
region: env_config.fetch(:region),
|
18
17
|
)
|
19
18
|
@env_config = env_config
|
20
19
|
end
|
data/lib/vm_shepherd/shepherd.rb
CHANGED
@@ -200,6 +200,7 @@ module VmShepherd
|
|
200
200
|
stack_name: settings.vm_shepherd.env_config.stack_name,
|
201
201
|
aws_access_key: settings.vm_shepherd.env_config.aws_access_key,
|
202
202
|
aws_secret_key: settings.vm_shepherd.env_config.aws_secret_key,
|
203
|
+
region: settings.vm_shepherd.env_config.region,
|
203
204
|
json_file: settings.vm_shepherd.env_config.json_file,
|
204
205
|
parameters: settings.vm_shepherd.env_config.parameters_as_a_hash,
|
205
206
|
outputs: settings.vm_shepherd.env_config.outputs.to_h,
|
data/lib/vm_shepherd/version.rb
CHANGED
@@ -14,6 +14,7 @@ module VmShepherd
|
|
14
14
|
stack_name: 'aws-stack-name',
|
15
15
|
aws_access_key: 'aws-access-key',
|
16
16
|
aws_secret_key: 'aws-secret-key',
|
17
|
+
region: 'us-east-1',
|
17
18
|
json_file: 'cloudformation.json',
|
18
19
|
parameters: {
|
19
20
|
'some_parameter' => 'some-answer',
|
@@ -42,7 +43,7 @@ module VmShepherd
|
|
42
43
|
expect(AWS).to receive(:config).with(
|
43
44
|
access_key_id: env_config.fetch(:aws_access_key),
|
44
45
|
secret_access_key: env_config.fetch(:aws_secret_key),
|
45
|
-
region:
|
46
|
+
region: env_config.fetch(:region),
|
46
47
|
)
|
47
48
|
|
48
49
|
allow(AWS).to receive(:ec2).and_return(ec2)
|
@@ -14,6 +14,7 @@ module VmShepherd
|
|
14
14
|
stack_name: 'aws-stack-name',
|
15
15
|
aws_access_key: 'aws-access-key',
|
16
16
|
aws_secret_key: 'aws-secret-key',
|
17
|
+
region: 'aws-region',
|
17
18
|
json_file: 'cloudformation.json',
|
18
19
|
parameters: {
|
19
20
|
'key_pair_name' => 'key_pair_name'
|
@@ -25,6 +26,10 @@ module VmShepherd
|
|
25
26
|
private_subnet_id: 'private-subnet-id',
|
26
27
|
s3_bucket_name: 'bucket-name',
|
27
28
|
},
|
29
|
+
}.merge(aws_elb_config)
|
30
|
+
end
|
31
|
+
let(:aws_elb_config) do
|
32
|
+
{
|
28
33
|
elb: {
|
29
34
|
name: 'some-elb-name',
|
30
35
|
port_mappings: [[1111, 11]],
|
@@ -190,25 +195,7 @@ module VmShepherd
|
|
190
195
|
|
191
196
|
context 'when there is no ELB configuration' do
|
192
197
|
let(:settings_fixture_name) { 'aws-no-elb.yml' }
|
193
|
-
|
194
|
-
let(:aws_env_config) do
|
195
|
-
{
|
196
|
-
stack_name: 'aws-stack-name',
|
197
|
-
aws_access_key: 'aws-access-key',
|
198
|
-
aws_secret_key: 'aws-secret-key',
|
199
|
-
json_file: 'cloudformation.json',
|
200
|
-
parameters: {
|
201
|
-
'key_pair_name' => 'key_pair_name'
|
202
|
-
},
|
203
|
-
outputs: {
|
204
|
-
ssh_key_name: 'ssh-key-name',
|
205
|
-
security_group: 'security-group-id',
|
206
|
-
public_subnet_id: 'public-subnet-id',
|
207
|
-
private_subnet_id: 'private-subnet-id',
|
208
|
-
s3_bucket_name: 'bucket-name',
|
209
|
-
},
|
210
|
-
}
|
211
|
-
end
|
198
|
+
let(:aws_elb_config) { {} }
|
212
199
|
|
213
200
|
it 'uses AwsManager to launch a VM' do
|
214
201
|
expect(AwsManager).to receive(:new).with(aws_env_config).and_return(aws_manager)
|
@@ -382,25 +369,7 @@ module VmShepherd
|
|
382
369
|
|
383
370
|
context 'when there is no ELB configuration' do
|
384
371
|
let(:settings_fixture_name) { 'aws-no-elb.yml' }
|
385
|
-
|
386
|
-
let(:aws_env_config) do
|
387
|
-
{
|
388
|
-
stack_name: 'aws-stack-name',
|
389
|
-
aws_access_key: 'aws-access-key',
|
390
|
-
aws_secret_key: 'aws-secret-key',
|
391
|
-
json_file: 'cloudformation.json',
|
392
|
-
parameters: {
|
393
|
-
'key_pair_name' => 'key_pair_name'
|
394
|
-
},
|
395
|
-
outputs: {
|
396
|
-
ssh_key_name: 'ssh-key-name',
|
397
|
-
security_group: 'security-group-id',
|
398
|
-
public_subnet_id: 'public-subnet-id',
|
399
|
-
private_subnet_id: 'private-subnet-id',
|
400
|
-
s3_bucket_name: 'bucket-name',
|
401
|
-
},
|
402
|
-
}
|
403
|
-
end
|
372
|
+
let(:aws_elb_config) {{}}
|
404
373
|
|
405
374
|
it 'uses AwsManager to destroy a VM' do
|
406
375
|
expect(AwsManager).to receive(:new).with(aws_env_config).and_return(aws_manager)
|
@@ -578,25 +547,7 @@ module VmShepherd
|
|
578
547
|
|
579
548
|
context 'when there is no ELB configuration' do
|
580
549
|
let(:settings_fixture_name) { 'aws-no-elb.yml' }
|
581
|
-
|
582
|
-
let(:aws_env_config) do
|
583
|
-
{
|
584
|
-
stack_name: 'aws-stack-name',
|
585
|
-
aws_access_key: 'aws-access-key',
|
586
|
-
aws_secret_key: 'aws-secret-key',
|
587
|
-
json_file: 'cloudformation.json',
|
588
|
-
parameters: {
|
589
|
-
'key_pair_name' => 'key_pair_name'
|
590
|
-
},
|
591
|
-
outputs: {
|
592
|
-
ssh_key_name: 'ssh-key-name',
|
593
|
-
security_group: 'security-group-id',
|
594
|
-
public_subnet_id: 'public-subnet-id',
|
595
|
-
private_subnet_id: 'private-subnet-id',
|
596
|
-
s3_bucket_name: 'bucket-name',
|
597
|
-
},
|
598
|
-
}
|
599
|
-
end
|
550
|
+
let(:aws_elb_config) {{}}
|
600
551
|
|
601
552
|
it 'uses AwsManager to destroy a VM' do
|
602
553
|
expect(AwsManager).to receive(:new).with(aws_env_config).and_return(aws_manager)
|
@@ -659,25 +610,7 @@ module VmShepherd
|
|
659
610
|
|
660
611
|
context 'when there is no ELB configuration' do
|
661
612
|
let(:settings_fixture_name) { 'aws-no-elb.yml' }
|
662
|
-
|
663
|
-
let(:aws_env_config) do
|
664
|
-
{
|
665
|
-
stack_name: 'aws-stack-name',
|
666
|
-
aws_access_key: 'aws-access-key',
|
667
|
-
aws_secret_key: 'aws-secret-key',
|
668
|
-
json_file: 'cloudformation.json',
|
669
|
-
parameters: {
|
670
|
-
'key_pair_name' => 'key_pair_name'
|
671
|
-
},
|
672
|
-
outputs: {
|
673
|
-
ssh_key_name: 'ssh-key-name',
|
674
|
-
security_group: 'security-group-id',
|
675
|
-
public_subnet_id: 'public-subnet-id',
|
676
|
-
private_subnet_id: 'private-subnet-id',
|
677
|
-
s3_bucket_name: 'bucket-name',
|
678
|
-
},
|
679
|
-
}
|
680
|
-
end
|
613
|
+
let(:aws_elb_config) {{}}
|
681
614
|
|
682
615
|
it 'uses AwsManager to create an environment' do
|
683
616
|
expect(AwsManager).to receive(:new).with(aws_env_config).and_return(ams_manager)
|
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: 1.
|
4
|
+
version: 1.4.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: 2015-06-
|
11
|
+
date: 2015-06-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-v1
|