From 862d1f7acda853d63ef74343f0f54d761017c9e5 Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Mon, 10 Dec 2007 22:50:43 -0600 Subject: Adding an Indirection reference, along with the work necessary to support it. --- lib/puppet/reference/indirection.rb | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 lib/puppet/reference/indirection.rb (limited to 'lib/puppet/reference') diff --git a/lib/puppet/reference/indirection.rb b/lib/puppet/reference/indirection.rb new file mode 100644 index 000000000..074398120 --- /dev/null +++ b/lib/puppet/reference/indirection.rb @@ -0,0 +1,34 @@ +require 'puppet/indirector/indirection' +require 'puppet/checksum' +require 'puppet/file_serving/content' +require 'puppet/file_serving/metadata' + +reference = Puppet::Util::Reference.newreference :indirection, :doc => "Indirection types and their terminus classes" do + text = "" + Puppet::Indirector::Indirection.instances.sort { |a,b| a.to_s <=> b.to_s }.each do |indirection| + ind = Puppet::Indirector::Indirection.instance(indirection) + name = indirection.to_s.capitalize + text += indirection.to_s + "\n" + ("-" * name.length) + "\n\n" + + text += ind.doc + "\n\n" + + Puppet::Indirector::Terminus.terminus_classes(ind.name).sort { |a,b| a.to_s <=> b.to_s }.each do |terminus| + text += terminus.to_s + "\n" + ("+" * terminus.to_s.length) + "\n\n" + + term_class = Puppet::Indirector::Terminus.terminus_class(ind.name, terminus) + + text += Puppet::Util::Docs.scrub(term_class.doc) + "\n\n" + end + end + + text +end + +reference.header = "This is the list of all indirections, their associated terminus classes, and how you select between them. + +In general, the appropriate terminus class is selected by the application for you (e.g., ``puppetd`` would always use the ``rest`` +terminus for most of its indirected classes), but some classes are tunable via normal settings. These will have ``terminus setting`` +documentation listed with them. + + +" -- cgit