ironfan 5.0.4 → 5.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/ironfan.gemspec +2 -2
- data/lib/ironfan/dsl/component.rb +7 -11
- data/spec/ironfan/plugin_spec.rb +23 -3
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
5.0.
|
1
|
+
5.0.5
|
data/ironfan.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "ironfan"
|
8
|
-
s.version = "5.0.
|
8
|
+
s.version = "5.0.5"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Infochimps"]
|
12
|
-
s.date = "2013-12-
|
12
|
+
s.date = "2013-12-18"
|
13
13
|
s.description = "Ironfan allows you to orchestrate not just systems but clusters of machines. It includes a powerful layer on top of knife and a collection of cloud cookbooks."
|
14
14
|
s.email = "coders@infochimps.com"
|
15
15
|
s.extra_rdoc_files = [
|
@@ -92,23 +92,23 @@ module Ironfan
|
|
92
92
|
|
93
93
|
def set_discovery compute, keys
|
94
94
|
if server_cluster
|
95
|
-
wire_to(compute, full_server_cluster,
|
95
|
+
wire_to(compute, full_server_cluster, keys)
|
96
96
|
else
|
97
97
|
# I'm defanging automatic discovery for now.
|
98
98
|
raise StandardError.new("must explicitly specify a server_cluster for discovery")
|
99
99
|
# discover(announce_name) do |cluster_name, facet_name|
|
100
|
-
# wire_to(compute, cluster_name, facet_name, keys)
|
100
|
+
# wire_to(compute, [cluster_name, facet_name].join('-'), keys)
|
101
101
|
# end
|
102
102
|
end
|
103
103
|
end
|
104
104
|
|
105
|
-
def wire_to(compute,
|
106
|
-
discovery = {discovers: keys.reverse.inject(
|
105
|
+
def wire_to(compute, full_server_cluster_v, keys)
|
106
|
+
discovery = {discovers: keys.reverse.inject(full_server_cluster_v){|hsh,key| {key => hsh}}}
|
107
107
|
(compute.facet_role || compute.cluster_role).override_attributes(discovery)
|
108
108
|
|
109
109
|
# FIXME: This is Ec2-specific and probably doesn't belong here.
|
110
110
|
client_group_v = client_group(compute)
|
111
|
-
server_group_v =
|
111
|
+
server_group_v = security_group(full_server_cluster_v)
|
112
112
|
|
113
113
|
group_edge(compute.cloud(:ec2), client_group_v, :authorized_by_group, server_group_v)
|
114
114
|
group_edge(compute.cloud(:ec2), client_group_v, :authorize_group, server_group_v) if bidirectional
|
@@ -131,12 +131,8 @@ module Ironfan
|
|
131
131
|
Chef::Log.debug("component.rb: allowing access from security group #{group_1} to #{group_2}")
|
132
132
|
end
|
133
133
|
|
134
|
-
def security_group(
|
135
|
-
|
136
|
-
end
|
137
|
-
|
138
|
-
def server_group(cluster_name, facet_name)
|
139
|
-
security_group(cluster_name, facet_name)
|
134
|
+
def security_group(*target_components)
|
135
|
+
target_components.compact.join('-')
|
140
136
|
end
|
141
137
|
end
|
142
138
|
|
data/spec/ironfan/plugin_spec.rb
CHANGED
@@ -93,7 +93,6 @@ describe Ironfan::Dsl::Component do
|
|
93
93
|
include Ironfan::Dsl::Component::Discovery if not server_b
|
94
94
|
|
95
95
|
if bidirectional and not server_b
|
96
|
-
STDERR.puts("defaulting #{name} to bidirectional")
|
97
96
|
default_to_bidirectional
|
98
97
|
end
|
99
98
|
|
@@ -116,6 +115,7 @@ describe Ironfan::Dsl::Component do
|
|
116
115
|
make_plugin_pair(:bam)
|
117
116
|
make_plugin_pair(:pow)
|
118
117
|
make_plugin_pair(:zap, true)
|
118
|
+
make_plugin_pair(:bop)
|
119
119
|
|
120
120
|
Ironfan.realm(:wap) do
|
121
121
|
cloud(:ec2)
|
@@ -137,12 +137,26 @@ describe Ironfan::Dsl::Component do
|
|
137
137
|
cluster(:bif) do
|
138
138
|
zap_server
|
139
139
|
end
|
140
|
+
|
141
|
+
cluster(:bam) do
|
142
|
+
facet(:wak) do
|
143
|
+
bop_client{ server_cluster :bop }
|
144
|
+
end
|
145
|
+
end
|
146
|
+
|
147
|
+
cluster(:bop) do
|
148
|
+
facet(:pow) do
|
149
|
+
bop_server
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
140
153
|
end.resolve!
|
141
154
|
end
|
142
155
|
|
143
156
|
after(:each) do
|
144
|
-
[:BamServer, :BamClient, :PowServer,
|
145
|
-
:
|
157
|
+
[:BamServer, :BamClient, :PowServer, :PowClient,
|
158
|
+
:ZapClient, :ZapServer, :BopServer, :BopClient,
|
159
|
+
].each do |class_name|
|
146
160
|
Ironfan::Dsl::Component.send(:remove_const, class_name)
|
147
161
|
end
|
148
162
|
end
|
@@ -166,5 +180,11 @@ describe Ironfan::Dsl::Component do
|
|
166
180
|
it 'does not configure extra security groups during bidirectional discovery' do
|
167
181
|
Ironfan.realm(:wap).cluster(:baz).cloud(:ec2).security_groups.keys.should_not include('wap_bif')
|
168
182
|
end
|
183
|
+
|
184
|
+
it 'correctly sets the server cluster even when the client and server facets differ' do
|
185
|
+
bam_wak_group = Ironfan.realm(:wap).cluster(:bam).facet(:wak).cloud(:ec2).security_group('wap_bam-wak')
|
186
|
+
bam_wak_group.group_authorized_by.should include('wap_bop')
|
187
|
+
end
|
188
|
+
|
169
189
|
end
|
170
190
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ironfan
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.
|
4
|
+
version: 5.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-12-
|
12
|
+
date: 2013-12-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: chef
|
@@ -410,7 +410,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
410
410
|
version: '0'
|
411
411
|
segments:
|
412
412
|
- 0
|
413
|
-
hash:
|
413
|
+
hash: 484463336952963862
|
414
414
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
415
415
|
none: false
|
416
416
|
requirements:
|