kelbim 0.3.0.beta2 → 0.3.0.beta3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/kelbim/dsl/converter.rb +5 -0
- data/lib/kelbim/exporter.rb +1 -0
- data/lib/kelbim/ext/elb-listener-ext.rb +13 -1
- data/lib/kelbim/version.rb +1 -1
- data/lib/kelbim/wrapper/listener.rb +31 -2
- 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: 730d02c7b0af20ca6ef821c7d29d2fcb4c28c2e3
|
4
|
+
data.tar.gz: 14f42001d200a19a2c62ca67582d64a3ce4569e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e5da86b232b0fa27b09ad53ec97d1cf02e60cc799cd2571001931e85d53e7bc1e80d9b5ec86700ebc81696f2c5a1bba6c567af622403a952e8fe1df038a3176
|
7
|
+
data.tar.gz: 8d0f04b83bcc412ffe24ba4f6a3f0b71de090b7faa8028aadb91f9ba92d5e119335b01dea17548226ebaef65f89a2de0eefe76dc08ac5a5cff79d7bcd66575ab
|
data/lib/kelbim/dsl/converter.rb
CHANGED
@@ -139,6 +139,7 @@ end
|
|
139
139
|
instance_port = listener[:instance_port]
|
140
140
|
policies = listener[:policies]
|
141
141
|
server_certificate = listener[:server_certificate]
|
142
|
+
ssl_certificate_id = listener[:ssl_certificate_id]
|
142
143
|
|
143
144
|
out = "listener [#{protocol}, #{port}] => [#{instance_protocol}, #{instance_port}]"
|
144
145
|
|
@@ -160,6 +161,10 @@ end
|
|
160
161
|
out << " server_certificate #{server_certificate.name.inspect}\n"
|
161
162
|
end
|
162
163
|
|
164
|
+
if ssl_certificate_id
|
165
|
+
out << " ssl_certificate_id #{ssl_certificate_id.inspect}\n"
|
166
|
+
end
|
167
|
+
|
163
168
|
out << " end"
|
164
169
|
|
165
170
|
return out
|
data/lib/kelbim/exporter.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require 'aws-sdk
|
1
|
+
require 'aws-sdk'
|
2
2
|
|
3
3
|
module AWS
|
4
4
|
class ELB
|
@@ -16,6 +16,18 @@ module AWS
|
|
16
16
|
load_balancer.policies.find {|i| i.name == name }
|
17
17
|
end
|
18
18
|
end
|
19
|
+
|
20
|
+
def ssl_certificate_id
|
21
|
+
_description[:listener][:ssl_certificate_id]
|
22
|
+
end
|
23
|
+
|
24
|
+
def ssl_certificate_id=(arn)
|
25
|
+
client.set_load_balancer_listener_ssl_certificate(
|
26
|
+
:load_balancer_name => load_balancer.name,
|
27
|
+
:load_balancer_port => port,
|
28
|
+
:ssl_certificate_id => arn)
|
29
|
+
nil
|
30
|
+
end
|
19
31
|
end # Listener
|
20
32
|
end # ELB
|
21
33
|
end # AWS
|
data/lib/kelbim/version.rb
CHANGED
@@ -9,7 +9,7 @@ module Kelbim
|
|
9
9
|
|
10
10
|
def_delegators(
|
11
11
|
:@listener,
|
12
|
-
:protocol, :port, :instance_protocol, :instance_port, :load_balancer)
|
12
|
+
:protocol, :port, :instance_protocol, :instance_port, :load_balancer, :ssl_certificate_id)
|
13
13
|
|
14
14
|
def initialize(listener, options)
|
15
15
|
@listener = listener
|
@@ -21,7 +21,7 @@ module Kelbim
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def eql?(dsl)
|
24
|
-
not has_difference_protocol_port?(dsl) and compare_server_certificate(dsl)
|
24
|
+
not has_difference_protocol_port?(dsl) and compare_server_certificate(dsl) and compare_ssl_certificate_id(dsl)
|
25
25
|
end
|
26
26
|
|
27
27
|
def update(dsl)
|
@@ -42,6 +42,16 @@ module Kelbim
|
|
42
42
|
@options.updated = true
|
43
43
|
end
|
44
44
|
end
|
45
|
+
|
46
|
+
compare_ssl_certificate_id(dsl) do |old_data, new_data|
|
47
|
+
log(:info, " ssl_certificate_id:", :green)
|
48
|
+
log(:info, Kelbim::Utils.diff(old_data, new_data, :color => @options[:color], :indent => ' '), false)
|
49
|
+
|
50
|
+
unless @options.dry_run
|
51
|
+
@listener.ssl_certificate_id = @dsl.ssl_certificate_id
|
52
|
+
@options.updated = true
|
53
|
+
end
|
54
|
+
end
|
45
55
|
end
|
46
56
|
|
47
57
|
def update_policies(policy_list, old_policy_list)
|
@@ -96,10 +106,29 @@ module Kelbim
|
|
96
106
|
def compare_server_certificate(dsl)
|
97
107
|
aws_server_certificate = @listener.server_certificate
|
98
108
|
aws_server_certificate = aws_server_certificate.name if aws_server_certificate
|
109
|
+
|
110
|
+
# XXX:
|
111
|
+
if not aws_server_certificate.nil? and dsl.server_certificate.nil?
|
112
|
+
log(:warn, "It can not be server_certificate to nil", :yellow, log_id)
|
113
|
+
return true
|
114
|
+
end
|
115
|
+
|
99
116
|
same = (aws_server_certificate == dsl.server_certificate)
|
100
117
|
yield(aws_server_certificate, dsl.server_certificate) if !same && block_given?
|
101
118
|
return same
|
102
119
|
end
|
120
|
+
|
121
|
+
def compare_ssl_certificate_id(dsl)
|
122
|
+
# XXX:
|
123
|
+
if not @listener.ssl_certificate_id.nil? and dsl.ssl_certificate_id.nil?
|
124
|
+
log(:warn, "It can not be ssl_certificate_id to nil", :yellow, log_id)
|
125
|
+
return true
|
126
|
+
end
|
127
|
+
|
128
|
+
same = (@listener.ssl_certificate_id == dsl.ssl_certificate_id)
|
129
|
+
yield(@listener.ssl_certificate_id, dsl.ssl_certificate_id) if !same && block_given?
|
130
|
+
return same
|
131
|
+
end
|
103
132
|
end # Listener
|
104
133
|
end # ListenerCollection
|
105
134
|
end # LoadBalancer
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kelbim
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.0.
|
4
|
+
version: 0.3.0.beta3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- winebarrel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-v1
|