cluster_chef 3.0.8 → 3.0.9

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -212,8 +212,7 @@ to the chef server. (see below for details).
212
212
  Hooray! You're ready to launch a cluster:
213
213
 
214
214
  ```ruby
215
- knife cluster launch demosimple homebase --bootstrap
216
- </pre>
215
+ knife cluster launch demosimple homebase --bootstrap```
217
216
 
218
217
  It will kick off a node and then bootstrap it. You'll see it install a whole bunch of things. Yay.
219
218
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.0.8
1
+ 3.0.9
data/cluster_chef.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "cluster_chef"
8
- s.version = "3.0.8"
8
+ s.version = "3.0.9"
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 = "2011-12-14"
12
+ s.date = "2011-12-16"
13
13
  s.description = "cluster_chef 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 = [
@@ -83,7 +83,7 @@ Gem::Specification.new do |s|
83
83
  s.add_development_dependency(%q<rspec>, ["~> 2.5"])
84
84
  s.add_development_dependency(%q<yard>, ["~> 0.6"])
85
85
  s.add_development_dependency(%q<configliere>, ["~> 0.4.8"])
86
- s.add_runtime_dependency(%q<cluster_chef-knife>, ["= 3.0.8"])
86
+ s.add_runtime_dependency(%q<cluster_chef-knife>, ["= 3.0.9"])
87
87
  else
88
88
  s.add_dependency(%q<chef>, ["~> 0.10.4"])
89
89
  s.add_dependency(%q<fog>, ["~> 1.1.1"])
@@ -94,7 +94,7 @@ Gem::Specification.new do |s|
94
94
  s.add_dependency(%q<rspec>, ["~> 2.5"])
95
95
  s.add_dependency(%q<yard>, ["~> 0.6"])
96
96
  s.add_dependency(%q<configliere>, ["~> 0.4.8"])
97
- s.add_dependency(%q<cluster_chef-knife>, ["= 3.0.8"])
97
+ s.add_dependency(%q<cluster_chef-knife>, ["= 3.0.9"])
98
98
  end
99
99
  else
100
100
  s.add_dependency(%q<chef>, ["~> 0.10.4"])
@@ -106,7 +106,7 @@ Gem::Specification.new do |s|
106
106
  s.add_dependency(%q<rspec>, ["~> 2.5"])
107
107
  s.add_dependency(%q<yard>, ["~> 0.6"])
108
108
  s.add_dependency(%q<configliere>, ["~> 0.4.8"])
109
- s.add_dependency(%q<cluster_chef-knife>, ["= 3.0.8"])
109
+ s.add_dependency(%q<cluster_chef-knife>, ["= 3.0.9"])
110
110
  end
111
111
  end
112
112
 
data/lib/cluster_chef.rb CHANGED
@@ -1,4 +1,6 @@
1
1
  require 'chef/mash'
2
+ require 'chef/config'
3
+ #
2
4
  require 'gorillib/metaprogramming/class_attribute'
3
5
  require 'gorillib/hash/reverse_merge'
4
6
  require 'gorillib/object/blank'
@@ -116,7 +116,7 @@ module ClusterChef
116
116
 
117
117
  # run list elements grouped into :first, :normal and :last
118
118
  def run_list_groups
119
- @run_list_info.keys.sort_by{|item| @run_list_info[:rank] }.group_by{|item| @run_list_info[item][:placement] }
119
+ @run_list_info.keys.sort_by{|item| @run_list_info[item][:rank] }.group_by{|item| @run_list_info[item][:placement] }
120
120
  end
121
121
 
122
122
  #
@@ -116,7 +116,11 @@ module ClusterChef
116
116
  def discover_addresses!
117
117
  servers.each(&:discover_addresses!)
118
118
  end
119
- end
119
+
120
+ end # ClusterChef::Cluster
121
+ end
122
+
123
+ module ClusterChef
120
124
 
121
125
  def self.fog_connection
122
126
  @fog_connection ||= Fog::Compute.new({
@@ -133,18 +137,21 @@ module ClusterChef
133
137
  @fog_servers = ClusterChef.fog_connection.servers.all
134
138
  end
135
139
 
136
- def self.fog_volumes
137
- return @fog_volumes if @fog_volumes
138
- Chef::Log.debug("Using fog to catalog all volumes")
139
- @fog_volumes ||= ClusterChef.fog_connection.volumes
140
- end
141
-
142
140
  def self.fog_addresses
143
141
  return @fog_addresses if @fog_addresses
144
142
  Chef::Log.debug("Using fog to catalog all addresses")
145
143
  @fog_addresses = {}.tap{|hsh| ClusterChef.fog_connection.addresses.each{|fa| hsh[fa.public_ip] = fa } }
146
144
  end
147
145
 
146
+ def self.fog_volumes
147
+ @fog_volumes || fetch_fog_volumes
148
+ end
149
+
150
+ def self.fetch_fog_volumes
151
+ Chef::Log.debug("Using fog to catalog all volumes")
152
+ @fog_volumes = ClusterChef.fog_connection.volumes
153
+ end
154
+
148
155
  def self.fog_keypairs
149
156
  return @fog_keypairs if @fog_keypairs
150
157
  Chef::Log.debug("Using fog to catalog all keypairs")
@@ -38,9 +38,11 @@ module ClusterChef
38
38
  # Takes key-value pairs and idempotently sets those tags on the cloud machine
39
39
  #
40
40
  def fog_create_tags(fog_obj, desc, tags)
41
- tags.each do |key, value|
42
- next if fog_obj.tags[key] == value.to_s
43
- Chef::Log.debug( "tagging #{key} = #{value} on #{desc}" )
41
+ tags_to_create = tags.reject{|key, val| fog_obj.tags[key] == val.to_s }
42
+ return if tags_to_create.empty?
43
+ step(" tagging #{desc} with #{tags_to_create.inspect}", :green)
44
+ tags_to_create.each do |key, value|
45
+ Chef::Log.debug( "tagging #{desc} with #{key} = #{value}" )
44
46
  safely do
45
47
  ClusterChef.fog_connection.tags.create({
46
48
  :key => key, :value => value.to_s, :resource_id => fog_obj.id })
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cluster_chef
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.8
4
+ version: 3.0.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-12-14 00:00:00.000000000 Z
12
+ date: 2011-12-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: chef
16
- requirement: &70174892097080 !ruby/object:Gem::Requirement
16
+ requirement: &70343611049240 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.10.4
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70174892097080
24
+ version_requirements: *70343611049240
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: fog
27
- requirement: &70174892095600 !ruby/object:Gem::Requirement
27
+ requirement: &70343611048760 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 1.1.1
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70174892095600
35
+ version_requirements: *70343611048760
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: formatador
38
- requirement: &70174892094120 !ruby/object:Gem::Requirement
38
+ requirement: &70343611048180 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 0.2.1
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70174892094120
46
+ version_requirements: *70343611048180
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: gorillib
49
- requirement: &70174892092520 !ruby/object:Gem::Requirement
49
+ requirement: &70343611047680 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 0.1.7
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *70174892092520
57
+ version_requirements: *70343611047680
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: bundler
60
- requirement: &70174892090980 !ruby/object:Gem::Requirement
60
+ requirement: &70343611047060 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '1'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *70174892090980
68
+ version_requirements: *70343611047060
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: jeweler
71
- requirement: &70174892090160 !ruby/object:Gem::Requirement
71
+ requirement: &70343611046520 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ~>
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '1.6'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *70174892090160
79
+ version_requirements: *70343611046520
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: rspec
82
- requirement: &70174892089660 !ruby/object:Gem::Requirement
82
+ requirement: &70343611046020 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ~>
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: '2.5'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *70174892089660
90
+ version_requirements: *70343611046020
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: yard
93
- requirement: &70174892089040 !ruby/object:Gem::Requirement
93
+ requirement: &70343611045520 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ~>
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: '0.6'
99
99
  type: :development
100
100
  prerelease: false
101
- version_requirements: *70174892089040
101
+ version_requirements: *70343611045520
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: configliere
104
- requirement: &70174892088480 !ruby/object:Gem::Requirement
104
+ requirement: &70343611045020 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ~>
@@ -109,18 +109,18 @@ dependencies:
109
109
  version: 0.4.8
110
110
  type: :development
111
111
  prerelease: false
112
- version_requirements: *70174892088480
112
+ version_requirements: *70343611045020
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: cluster_chef-knife
115
- requirement: &70174892087940 !ruby/object:Gem::Requirement
115
+ requirement: &70343611044520 !ruby/object:Gem::Requirement
116
116
  none: false
117
117
  requirements:
118
118
  - - =
119
119
  - !ruby/object:Gem::Version
120
- version: 3.0.8
120
+ version: 3.0.9
121
121
  type: :runtime
122
122
  prerelease: false
123
- version_requirements: *70174892087940
123
+ version_requirements: *70343611044520
124
124
  description: cluster_chef allows you to orchestrate not just systems but clusters
125
125
  of machines. It includes a powerful layer on top of knife and a collection of cloud
126
126
  cookbooks.
@@ -191,7 +191,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
191
191
  version: '0'
192
192
  segments:
193
193
  - 0
194
- hash: -3376503058401634367
194
+ hash: -900538870253244074
195
195
  required_rubygems_version: !ruby/object:Gem::Requirement
196
196
  none: false
197
197
  requirements: