vm_shepherd 3.0.8 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0a0849bb2535214c6f36d2587fba1b49539cc10d
4
- data.tar.gz: 956cd94e7372420ade106411e5bee1a1b2de11bf
3
+ metadata.gz: f8b26ee24179e3a6eac7866b2fc7e6eae8c7920d
4
+ data.tar.gz: cfe1558e6ba8f8e2cb1e4793d792ee83624c3fe0
5
5
  SHA512:
6
- metadata.gz: 96bca2b1fa4ee198c50802ea3b14ed10393bea9392ef5b7ad670516404420859c4bfad94ae2bc9c6ebe1dd010b82d3047eb57ceb67404bc49c7794a3791aba40
7
- data.tar.gz: 00fd41ab55b1d82db8741245264bd2ccf9b31d1e234d24ad7a615d23f4e37e42574d9bb073076587ab4be70e6c5e7c5e0446a0fed45d987332bad70b07ce440a
6
+ metadata.gz: 782f788cbf16bb6c4180feab462392da640383a459ebc6114b883f10c6fdf24c879c1f26032ca1537f7754ca0eefe3ba157ee744c126dccea90f4aa64e0b690e
7
+ data.tar.gz: f0702d87ecd13df5d751093bb4108743fc9795d14ceff393c8ca481b3ba747a7788423f95abd5defc501f52b36e09bfd2aba5c205cfdbdd887f9110c8b498a45
@@ -62,7 +62,7 @@ module VmShepherd
62
62
  instance =
63
63
  retry_until do
64
64
  begin
65
- AWS.ec2.instances.create(instance_create_params(ami_file_path))
65
+ AWS.ec2.instances.create(instance_create_params(ami_file_path, vm_config))
66
66
  rescue AWS::EC2::Errors::InvalidIPAddress::InUse
67
67
  false
68
68
  end
@@ -133,11 +133,11 @@ module VmShepherd
133
133
  private
134
134
  attr_reader :env_config, :logger
135
135
 
136
- def instance_create_params(ami_file_path)
136
+ def instance_create_params(ami_file_path, vm_config)
137
137
  create_params =
138
138
  {
139
139
  image_id: read_ami_id(ami_file_path),
140
- key_name: env_config.fetch('outputs').fetch('ssh_key_name'),
140
+ key_name: vm_config.fetch('key_name'),
141
141
  security_group_ids: [env_config.fetch('outputs').fetch('security_group')],
142
142
  subnet: env_config.fetch('outputs').fetch('public_subnet_id'),
143
143
  instance_type: OPS_MANAGER_INSTANCE_TYPE
@@ -1,3 +1,3 @@
1
1
  module VmShepherd
2
- VERSION = '3.0.8'.freeze
2
+ VERSION = '3.1.0'.freeze
3
3
  end
@@ -10,11 +10,12 @@ vm_shepherd:
10
10
  parameters:
11
11
  key_pair_name: key_pair_name
12
12
  outputs:
13
- ssh_key_name: ssh-key-name
14
13
  security_group: security-group-id
15
14
  public_subnet_id: public-subnet-id
16
15
  subnets: [private-subnet-id, public-subnet-id]
17
16
  s3_bucket_name: bucket-name
18
17
  vm_configs:
19
18
  - vm_name: vm-name
19
+ key_name: ssh-key-name
20
20
  - vm_name: vm-name-2
21
+ key_name: ssh-key-name-2
@@ -10,7 +10,6 @@ vm_shepherd:
10
10
  parameters:
11
11
  key_pair_name: key_pair_name
12
12
  outputs:
13
- ssh_key_name: ssh-key-name
14
13
  security_group: security-group-id
15
14
  public_subnet_id: public-subnet-id
16
15
  subnets: [private-subnet-id, public-subnet-id]
@@ -28,4 +27,6 @@ vm_shepherd:
28
27
  subnet_id: CloudFormationSubnetIdOutputKey
29
28
  vm_configs:
30
29
  - vm_name: vm-name
30
+ key_name: ssh-key-name
31
31
  - vm_name: vm-name-2
32
+ key_name: ssh-key-name-2
@@ -26,7 +26,6 @@ module VmShepherd
26
26
  },
27
27
  'outputs' => {
28
28
  'subnets' => ['public-subnet-id', 'private-subnet-id'],
29
- 'ssh_key_name' => 'ssh-key-name',
30
29
  'security_group' => 'security-group-id',
31
30
  'public_subnet_id' => 'public-subnet-id',
32
31
  }.merge(extra_outputs),
@@ -39,6 +38,7 @@ module VmShepherd
39
38
  let(:vm_config) do
40
39
  {
41
40
  'vm_name' => 'some-vm-name',
41
+ 'key_name' => 'ssh-key-name',
42
42
  }
43
43
  end
44
44
  let(:fake_logger) { instance_double(Logger).as_null_object }
@@ -326,7 +326,8 @@ module VmShepherd
326
326
  let(:vm_config) do
327
327
  {
328
328
  'vm_name' => 'some-vm-name',
329
- 'vm_ip_address' => 'some-ip-address'
329
+ 'vm_ip_address' => 'some-ip-address',
330
+ 'key_name' => 'ssh-key-name',
330
331
  }
331
332
  end
332
333
 
@@ -20,7 +20,6 @@ module VmShepherd
20
20
  'key_pair_name' => 'key_pair_name'
21
21
  },
22
22
  'outputs' => {
23
- 'ssh_key_name' => 'ssh-key-name',
24
23
  'security_group' => 'security-group-id',
25
24
  'public_subnet_id' => 'public-subnet-id',
26
25
  'subnets' => ['private-subnet-id', 'public-subnet-id'],
@@ -193,8 +192,8 @@ module VmShepherd
193
192
  let(:aws_manager) { instance_double(AwsManager) }
194
193
  let(:first_ami_file_path) { 'PATH_TO_AMI_FILE' }
195
194
  let(:last_ami_file_path) { 'PATH_TO_AMI_FILE-2' }
196
- let(:first_aws_options) { {'vm_name' => 'vm-name'} }
197
- let(:last_aws_options) { {'vm_name' => 'vm-name-2'} }
195
+ let(:first_aws_options) { {'vm_name' => 'vm-name', 'key_name' => 'ssh-key-name'} }
196
+ let(:last_aws_options) { {'vm_name' => 'vm-name-2', 'key_name' => 'ssh-key-name-2'} }
198
197
 
199
198
  it 'uses AwsManager to launch a VM' do
200
199
  expect(AwsManager).to receive(:new).with(env_config: aws_env_config, logger: instance_of(Logger)).and_return(aws_manager)
@@ -373,8 +372,8 @@ module VmShepherd
373
372
  context 'when IAAS is AWS' do
374
373
  let(:settings_fixture_name) { 'aws.yml' }
375
374
  let(:aws_manager) { instance_double(AwsManager) }
376
- let(:first_ami_options) { {'vm_name' => 'vm-name'} }
377
- let(:last_ami_options) { {'vm_name' => 'vm-name-2'} }
375
+ let(:first_ami_options) { {'vm_name' => 'vm-name', 'key_name' => 'ssh-key-name'} }
376
+ let(:last_ami_options) { {'vm_name' => 'vm-name-2', 'key_name' => 'ssh-key-name-2'} }
378
377
 
379
378
  it 'uses AwsManager to destroy a VM' do
380
379
  expect(AwsManager).to receive(:new).with(env_config: aws_env_config, logger: instance_of(Logger)).and_return(aws_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: 3.0.8
4
+ version: 3.1.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: 2016-03-09 00:00:00.000000000 Z
11
+ date: 2016-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-v1
@@ -206,7 +206,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
206
206
  version: '0'
207
207
  requirements: []
208
208
  rubyforge_project:
209
- rubygems_version: 2.4.5.1
209
+ rubygems_version: 2.5.1
210
210
  signing_key:
211
211
  specification_version: 4
212
212
  summary: A tool for booting and tearing down Ops Manager VMs on various Infrastructures.