ironfan 4.1.1 → 4.2.0
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/chef/knife/cluster_show.rb +5 -1
- data/lib/ironfan/broker.rb +1 -1
- data/lib/ironfan/provider/chef/client.rb +2 -3
- data/lib/ironfan/provider/chef/node.rb +2 -2
- data/lib/ironfan/provider/chef/role.rb +3 -3
- data/lib/ironfan/provider/ec2/ebs_volume.rb +0 -1
- data/lib/ironfan/provider/ec2/key_pair.rb +0 -1
- data/lib/ironfan/provider/ec2/machine.rb +0 -1
- data/lib/ironfan/provider/ec2/placement_group.rb +1 -2
- data/lib/ironfan/provider/ec2/security_group.rb +0 -2
- data/lib/ironfan/provider.rb +6 -1
- data/spec/ironfan/cluster_spec.rb +17 -15
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
4.
|
1
|
+
4.2.0
|
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 = "4.
|
8
|
+
s.version = "4.2.0"
|
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 = "2012-09-
|
12
|
+
s.date = "2012-09-29"
|
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 = [
|
@@ -56,8 +56,12 @@ class Chef
|
|
56
56
|
protected
|
57
57
|
|
58
58
|
def dump_computer(computer)
|
59
|
+
header = "Computer #{computer.name} (#{computer.class})"
|
59
60
|
with_verbosity 1 do
|
60
|
-
|
61
|
+
Chef::Log.info(header)
|
62
|
+
end
|
63
|
+
with_verbosity 2 do
|
64
|
+
dump(header, computer.to_wire)
|
61
65
|
end
|
62
66
|
end
|
63
67
|
|
data/lib/ironfan/broker.rb
CHANGED
@@ -16,7 +16,7 @@ module Ironfan
|
|
16
16
|
computers = Computers.new(:cluster => cluster.resolve)
|
17
17
|
#
|
18
18
|
providers = computers.map{|c| c.providers.values }.flatten.uniq
|
19
|
-
providers
|
19
|
+
Ironfan.parallel(providers) do |provider|
|
20
20
|
Ironfan.step cluster.name, "Loading #{provider.handle}", :cyan
|
21
21
|
provider.load cluster
|
22
22
|
end
|
@@ -45,9 +45,8 @@ module Ironfan
|
|
45
45
|
# Discovery
|
46
46
|
#
|
47
47
|
def self.load!(cluster=nil)
|
48
|
-
|
49
|
-
|
50
|
-
ChefServer.search(:client, nameq) do |raw|
|
48
|
+
query = cluster && "name:#{cluster.name}-* OR clientname:#{cluster.name}-*"
|
49
|
+
ChefServer.search(:client, query) do |raw|
|
51
50
|
next unless raw.present?
|
52
51
|
client = register(raw)
|
53
52
|
Chef::Log.debug("Loaded #{client}")
|
@@ -88,8 +88,8 @@ module Ironfan
|
|
88
88
|
# Discovery
|
89
89
|
#
|
90
90
|
def self.load!(cluster=nil)
|
91
|
-
|
92
|
-
ChefServer.search(:node,
|
91
|
+
query = cluster && "name:#{cluster.name}-*"
|
92
|
+
ChefServer.search(:node, query) do |raw|
|
93
93
|
next unless raw.present?
|
94
94
|
node = register(raw)
|
95
95
|
Chef::Log.debug("Loaded #{node}")
|
@@ -46,9 +46,9 @@ module Ironfan
|
|
46
46
|
#
|
47
47
|
# Discovery
|
48
48
|
#
|
49
|
-
def self.load!(cluster)
|
50
|
-
|
51
|
-
ChefServer.search(:role,
|
49
|
+
def self.load!(cluster=nil)
|
50
|
+
query = cluster && "name:#{cluster.name}-*"
|
51
|
+
ChefServer.search(:role,query) do |raw|
|
52
52
|
next unless raw.present?
|
53
53
|
role = register(raw)
|
54
54
|
Chef::Log.debug("Loaded #{role}")
|
@@ -33,7 +33,6 @@ module Ironfan
|
|
33
33
|
# Discovery
|
34
34
|
#
|
35
35
|
def self.load!(cluster=nil)
|
36
|
-
Ironfan.substep(cluster && cluster.name, "keypairs")
|
37
36
|
Ec2.connection.key_pairs.each do |keypair|
|
38
37
|
register keypair unless keypair.blank?
|
39
38
|
Chef::Log.debug("Loaded <%-15s %s>" % [handle, keypair.name])
|
@@ -15,8 +15,7 @@ module Ironfan
|
|
15
15
|
"<%-15s %-12s %-12s>" % [ self.class.handle, '', name ]
|
16
16
|
end
|
17
17
|
|
18
|
-
def self.load!(cluster)
|
19
|
-
Ironfan.substep(cluster.name, "placement groups")
|
18
|
+
def self.load!(cluster=nil)
|
20
19
|
result = Ec2.connection.describe_placement_groups
|
21
20
|
result.body["placementGroupSet"].each do |group|
|
22
21
|
register group unless group.blank?
|
data/lib/ironfan/provider.rb
CHANGED
@@ -25,7 +25,12 @@ module Ironfan
|
|
25
25
|
# Discovery
|
26
26
|
#
|
27
27
|
def self.load(cluster)
|
28
|
-
|
28
|
+
Ironfan.parallel (resources) do |r|
|
29
|
+
type = r.resource_type.to_s
|
30
|
+
Ironfan.substep(cluster.name, "loading #{type}s")
|
31
|
+
r.load! cluster
|
32
|
+
Ironfan.substep(cluster.name, "loaded #{type}s")
|
33
|
+
end
|
29
34
|
end
|
30
35
|
|
31
36
|
def self.validate(computers)
|
@@ -3,21 +3,23 @@ require 'spec_helper'
|
|
3
3
|
require 'ironfan'
|
4
4
|
|
5
5
|
describe Ironfan::Dsl::Cluster do
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
instances 1
|
15
|
-
role :nfs_client, :first
|
16
|
-
end
|
17
|
-
end
|
6
|
+
subject do
|
7
|
+
Ironfan.cluster 'foo' do
|
8
|
+
environment :dev
|
9
|
+
|
10
|
+
role :generic
|
11
|
+
|
12
|
+
role :is_last, :last
|
13
|
+
role :is_first, :first
|
18
14
|
end
|
19
|
-
|
20
|
-
its(:environment) { should eql :dev }
|
21
|
-
its(:run_list) { should eql ["role[systemwide]"] }
|
22
15
|
end
|
16
|
+
|
17
|
+
its(:environment) { should eql :dev }
|
18
|
+
|
19
|
+
its(:run_list) { should eql [
|
20
|
+
"role[is_first]",
|
21
|
+
"role[generic]",
|
22
|
+
"role[is_last]"
|
23
|
+
]
|
24
|
+
}
|
23
25
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: ironfan
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 4.
|
5
|
+
version: 4.2.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Infochimps
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2012-09-
|
13
|
+
date: 2012-09-29 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: chef
|
@@ -229,7 +229,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
229
229
|
requirements:
|
230
230
|
- - ">="
|
231
231
|
- !ruby/object:Gem::Version
|
232
|
-
hash:
|
232
|
+
hash: 2633727153528237962
|
233
233
|
segments:
|
234
234
|
- 0
|
235
235
|
version: "0"
|