chef-provisioning-aws 0.2 → 0.2.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a417bfb510b60aceeac847e46aae75bb45e95f2e
|
4
|
+
data.tar.gz: 553832588205c18911e9093b6377f65d8c5736f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 959abe2a3e9b4907bf5dedbc4ef91251dd76db537045564add148c099a954e50307d723c71f845f508a3803ad3cdee41f3f91a393d4ad4dc4cace0fd4e7aa8d9
|
7
|
+
data.tar.gz: cdf01038f21b40cd6e728dcec4dc6182774b9e8c706c4d35c8d5e12dda89a0d66cf248ebc93cee6298181e4dff89c51d5ceb95f9b3cfae20b0983eab07625147
|
@@ -15,6 +15,7 @@ require 'chef/provisioning/aws_driver/credentials'
|
|
15
15
|
|
16
16
|
require 'yaml'
|
17
17
|
require 'aws-sdk-v1'
|
18
|
+
|
18
19
|
# loads the entire aws-sdk
|
19
20
|
AWS.eager_autoload!
|
20
21
|
|
@@ -58,17 +59,20 @@ module AWSDriver
|
|
58
59
|
|
59
60
|
# Load balancer methods
|
60
61
|
def allocate_load_balancer(action_handler, lb_spec, lb_options, machine_specs)
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
ec2.security_groups[security_group_id]
|
68
|
-
end
|
62
|
+
if lb_options[:security_group_id]
|
63
|
+
security_group = ec2.security_groups[:security_group_id]
|
64
|
+
elsif lb_options[:security_group_name]
|
65
|
+
security_group = ec2.security_groups.filter('group-name', lb_options[:security_group_name])
|
66
|
+
end
|
67
|
+
|
69
68
|
availability_zones = lb_options[:availability_zones]
|
70
69
|
listeners = lb_options[:listeners]
|
71
70
|
|
71
|
+
lb_optionals = {}
|
72
|
+
lb_optionals[:security_groups] = [security_group] if security_group
|
73
|
+
lb_optionals[:availability_zones] = availability_zones if availability_zones
|
74
|
+
lb_optionals[:listeners] = listeners if listeners
|
75
|
+
|
72
76
|
actual_elb = load_balancer_for(lb_spec)
|
73
77
|
if !actual_elb.exists?
|
74
78
|
perform_action = proc { |desc, &block| action_handler.perform_action(desc, &block) }
|
@@ -79,10 +83,7 @@ module AWSDriver
|
|
79
83
|
updates << " with security group #{security_group.name}" if security_group
|
80
84
|
|
81
85
|
action_handler.perform_action updates do
|
82
|
-
actual_elb = elb.load_balancers.create(lb_spec.name,
|
83
|
-
availability_zones: availability_zones,
|
84
|
-
listeners: listeners,
|
85
|
-
security_groups: [security_group])
|
86
|
+
actual_elb = elb.load_balancers.create(lb_spec.name, lb_optionals)
|
86
87
|
|
87
88
|
lb_spec.location = {
|
88
89
|
'driver_url' => driver_url,
|
@@ -322,9 +323,9 @@ module AWSDriver
|
|
322
323
|
end
|
323
324
|
end
|
324
325
|
wait_until_ready_machine(action_handler, machine_spec, instance)
|
325
|
-
wait_for_transport(action_handler, machine_spec, machine_options)
|
326
326
|
end
|
327
327
|
|
328
|
+
wait_for_transport(action_handler, machine_spec, machine_options)
|
328
329
|
machine_for(machine_spec, machine_options, instance)
|
329
330
|
end
|
330
331
|
|
@@ -530,12 +531,12 @@ module AWSDriver
|
|
530
531
|
|
531
532
|
def ssh_options_for(machine_spec, machine_options, instance)
|
532
533
|
result = {
|
533
|
-
# TODO create a user known hosts file
|
534
|
-
# :user_known_hosts_file => vagrant_ssh_config['UserKnownHostsFile'],
|
535
|
-
# :paranoid => true,
|
536
|
-
:auth_methods => [ 'publickey' ],
|
537
|
-
:keys_only => true,
|
538
|
-
:host_key_alias => "#{instance.id}.AWS"
|
534
|
+
# TODO create a user known hosts file
|
535
|
+
# :user_known_hosts_file => vagrant_ssh_config['UserKnownHostsFile'],
|
536
|
+
# :paranoid => true,
|
537
|
+
:auth_methods => [ 'publickey' ],
|
538
|
+
:keys_only => true,
|
539
|
+
:host_key_alias => "#{instance.id}.AWS"
|
539
540
|
}.merge(machine_options[:ssh_options] || {})
|
540
541
|
if instance.respond_to?(:private_key) && instance.private_key
|
541
542
|
result[:key_data] = [ instance.private_key ]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef-provisioning-aws
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Ewart
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chef
|