Skip to content
Browse files

fixed up the pickle_node recipe

  • Loading branch information...
1 parent e50957f commit aa7ef2b3305741d75a438ea6f231019365c3b3c2 Philip (flip) Kromer committed Feb 20, 2012
View
10 cookbooks/cloud_utils/recipes/pickle_node.rb
@@ -64,10 +64,10 @@
mode "0600" # only readable by root
end
-ruby_block('dump aspects') do
- block do
- Ironfan::Discovery.dump_aspects(self.run_context)
- end
-end
+# ruby_block('dump aspects') do
+# block do
+# Ironfan::Discovery.dump_aspects(self.run_context)
+# end
+# end
# rr = run_context.resource_collection.select{|r| r.is_a?(Chef::Resource::File) }.map(&:dup).each{|r| r.content '' }
View
54 cookbooks/silverware/libraries/dump_aspects.rb
@@ -4,74 +4,82 @@ module Discovery
def dump_aspects(run_context)
[
+ [:apache, :server],
[:cassandra, :server],
- [:chef_client, :client],
- # [:dash_dash, :dashboard],
- [:silverware, :dashboard],
+ [:chef, :client],
+ [:chef, :server],
[:cron, :daemon],
- [:elasticsearch, :datanode],
- [:elasticsearch, :httpnode],
+ [:elasticsearch, :server],
[:flume, :agent],
[:flume, :master],
[:ganglia, :master],
[:ganglia, :monitor],
[:graphite, :carbon],
[:graphite, :dashboard],
[:graphite, :whisper],
+ #
[:hadoop, :datanode],
[:hadoop, :hdfs_fuse],
[:hadoop, :jobtracker],
[:hadoop, :namenode],
[:hadoop, :secondarynn],
[:hadoop, :tasktracker],
+ #
[:hbase, :master],
[:hbase, :regionserver],
+ [:hbase, :thrift],
[:hbase, :stargate],
+ #
+ [:jenkins, :server],
+ [:jenkins, :worker],
+ [:minidash, :dashboard],
+ [:mongodb, :server],
+ [:mysql, :server],
[:nfs, :server],
[:nginx, :server],
[:ntp, :server],
[:redis, :server],
+ [:resque, :redis],
[:resque, :dashboard],
[:ssh, :daemon],
[:statsd, :server],
+ [:zabbix, :agent],
+ [:zabbix, :master],
[:zookeeper, :server],
- # [:apache, :server],
- # [:mongodb, :server],
- # [:mysql, :server],
- # [:zabbix, :monitor],
- # [:zabbix, :server],
# [:goliath, :app],
# [:unicorn, :app],
- # [:apt_cacher, :server],
+ # [:apt, :cacher],
# [:bluepill, :monitor],
# [:resque, :worker],
- ].each do |sys, component|
- aspects = announce(run_context, sys, component)
+ ].each do |sys, subsys|
+ components = discover_all(sys, subsys)
pad = ([""]*20)
- dump_line = dump(aspects) || []
- puts( "%-15s\t%-15s\t%-23s\t| %-51s\t| %-12s\t#{"%-7s\t"*12}" % [sys, component, dump_line, pad].flatten )
+ components.each do |component|
+ dump_line = dump(component) || []
+ puts( "%-15s\t%-15s\t%-23s\t| %-51s\t| %-12s\t#{"%-7s\t"*12}" % [sys, subsys, dump_line, pad].flatten )
+ end
end
run_context.resource_collection.select{|r| r.resource_name.to_s == 'service' }.each{|r| p [r.name, r.action] }
end
- def dump(aspects)
- return if aspects.empty?
+ def dump(component)
+ return if component.empty?
vals = [
- aspects[:daemon ].map{|asp| asp.name }.join(",")[0..20],
- aspects[:port ].map{|asp| "#{asp.flavor}=#{asp.port_num}" }.join(","),
- aspects[:dashboard ].map{|asp| asp.name }.join(","),
- aspects[:log ].map{|asp| asp.name }.join(","),
+ component.daemon .map{|asp| asp.name }.join(",")[0..20],
+ component.port .map{|asp| "#{asp.flavor}=#{asp.port_num}" }.join(","),
+ component.dashboard .map{|asp| asp.name }.join(","),
+ component.log .map{|asp| asp.name }.join(","),
DirectoryAspect::ALLOWED_FLAVORS.map do |flavor|
- asp = aspects[:directory ].detect{|asp| asp[:flavor] == flavor }
+ asp = component[:directory ].detect{|asp| asp[:flavor] == flavor }
# asp ? "#{asp.flavor}=#{asp.path}" : ""
asp ? asp.name : ""
end,
ExportedAspect::ALLOWED_FLAVORS.map do |flavor|
- asp = aspects[:exported ].detect{|asp| asp[:flavor] == flavor }
+ asp = component[:exported ].detect{|asp| asp[:flavor] == flavor }
# asp ? "#{asp.flavor}=#{asp.files.join(",")}" : ""
asp ? asp.name : ""
end,
View
4 cookbooks/silverware/recipes/default.rb
@@ -18,3 +18,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
+
+standard_dirs('silverware') do
+ directories :conf_dir, :log_dir, :home_dir
+end

0 comments on commit aa7ef2b

Please sign in to comment.
Something went wrong with that request. Please try again.