diff --git a/lib/puppet/face/catalog.rb b/lib/puppet/face/catalog.rb index da03af0fd..98f550413 100644 --- a/lib/puppet/face/catalog.rb +++ b/lib/puppet/face/catalog.rb @@ -1,55 +1,58 @@ require 'puppet/face/indirector' Puppet::Face::Indirector.define(:catalog, '0.0.1') do + copyright "Puppet Labs", 2011 + license "Apache 2 license; see COPYING" + summary "Compile, save, view, and convert catalogs." description <<-EOT This face primarily interacts with the compiling subsystem. By default, it compiles a catalog using the default manifest and the hostname from 'certname', but you can choose to retrieve a catalog from the server by specifying '--from rest'. You can also choose to print any catalog in 'dot' format (for easy graph viewing with OmniGraffle or Graphviz) with '--format dot'. EOT action(:apply) do summary "apply a Puppet::Resource::Catalog object" when_invoked do |catalog, options| report = Puppet::Transaction::Report.new("apply") report.configuration_version = catalog.version Puppet::Util::Log.newdestination(report) begin benchmark(:notice, "Finished catalog run") do catalog.apply(:report => report) end rescue => detail puts detail.backtrace if Puppet[:trace] Puppet.err "Failed to apply catalog: #{detail}" end report.finalize_report report end end action(:download) do summary "download the catalog given the certname and facts" when_invoked do |certname, facts, options| Puppet::Resource::Catalog.indirection.terminus_class = :rest facts_to_upload = {:facts_format => :b64_zlib_yaml, :facts => CGI.escape(facts.render(:b64_zlib_yaml))} catalog = nil retrieval_duration = thinmark do catalog = Puppet::Face[:catalog, '0.0.1'].find(certname, facts_to_upload) end catalog = catalog.to_ral catalog.finalize catalog.retrieval_duration = retrieval_duration catalog.write_class_file catalog end end end diff --git a/lib/puppet/face/certificate.rb b/lib/puppet/face/certificate.rb index 9ee83d0a2..7f2998da2 100644 --- a/lib/puppet/face/certificate.rb +++ b/lib/puppet/face/certificate.rb @@ -1,42 +1,45 @@ require 'puppet/face/indirector' require 'puppet/ssl/host' Puppet::Face::Indirector.define(:certificate, '0.0.1') do + copyright "Puppet Labs", 2011 + license "Apache 2 license; see COPYING" + summary "provide access to the CA for certificate management" option "--ca-location LOCATION" do before_action do |action, args, options| Puppet::SSL::Host.ca_location = options[:ca_location].to_sym end end action :generate do summary "Generate a new Certificate Signing Request for HOST" when_invoked do |name, options| host = Puppet::SSL::Host.new(name) host.generate_certificate_request host.certificate_request.class.indirection.save(host.certificate_request) end end action :list do summary "List all Certificate Signing Requests" when_invoked do |options| Puppet::SSL::Host.indirection.search("*", { :for => :certificate_request, }).map { |h| h.inspect } end end action :sign do summary "Sign a Certificate Signing Request for HOST" when_invoked do |name, options| host = Puppet::SSL::Host.new(name) host.desired_state = 'signed' Puppet::SSL::Host.indirection.save(host) end end end diff --git a/lib/puppet/face/certificate_request.rb b/lib/puppet/face/certificate_request.rb index 4e711b25b..0f7f72205 100644 --- a/lib/puppet/face/certificate_request.rb +++ b/lib/puppet/face/certificate_request.rb @@ -1,5 +1,8 @@ require 'puppet/face/indirector' Puppet::Face::Indirector.define(:certificate_request, '0.0.1') do + copyright "Puppet Labs", 2011 + license "Apache 2 license; see COPYING" + summary "Manage certificate requests." end diff --git a/lib/puppet/face/certificate_revocation_list.rb b/lib/puppet/face/certificate_revocation_list.rb index f111586af..9a8fe303d 100644 --- a/lib/puppet/face/certificate_revocation_list.rb +++ b/lib/puppet/face/certificate_revocation_list.rb @@ -1,5 +1,8 @@ require 'puppet/face/indirector' Puppet::Face::Indirector.define(:certificate_revocation_list, '0.0.1') do + copyright "Puppet Labs", 2011 + license "Apache 2 license; see COPYING" + summary "Manage the list of revoked certificates." end diff --git a/lib/puppet/face/config.rb b/lib/puppet/face/config.rb index d1f6d5a9e..fc685202c 100644 --- a/lib/puppet/face/config.rb +++ b/lib/puppet/face/config.rb @@ -1,14 +1,17 @@ require 'puppet/face' Puppet::Face.define(:config, '0.0.1') do + copyright "Puppet Labs", 2011 + license "Apache 2 license; see COPYING" + summary "Interact with Puppet configuration options." action(:print) do when_invoked do |*args| options = args.pop Puppet.settings[:configprint] = args.join(",") Puppet.settings.print_config_options nil end end end diff --git a/lib/puppet/face/facts.rb b/lib/puppet/face/facts.rb index abcb3369a..88e3c7ba9 100644 --- a/lib/puppet/face/facts.rb +++ b/lib/puppet/face/facts.rb @@ -1,21 +1,24 @@ require 'puppet/face/indirector' require 'puppet/node/facts' Puppet::Face::Indirector.define(:facts, '0.0.1') do + copyright "Puppet Labs", 2011 + license "Apache 2 license; see COPYING" + summary "Retrieve, store, and view facts." action(:upload) do summary "upload our facts to the server." render_as :yaml when_invoked do |options| Puppet::Node::Facts.indirection.terminus_class = :facter facts = Puppet::Node::Facts.indirection.find(Puppet[:certname]) Puppet::Node::Facts.indirection.terminus_class = :rest Puppet::Node::Facts.indirection.save(facts) Puppet.notice "Uploaded facts for '#{Puppet[:certname]}'" nil end end end diff --git a/lib/puppet/face/file.rb b/lib/puppet/face/file.rb index 547df3e4f..1b2e62b6d 100644 --- a/lib/puppet/face/file.rb +++ b/lib/puppet/face/file.rb @@ -1,7 +1,10 @@ require 'puppet/face/indirector' Puppet::Face::Indirector.define(:file, '0.0.1') do + copyright "Puppet Labs", 2011 + license "Apache 2 license; see COPYING" + summary "Retrieve and store files in a filebucket" set_indirection_name :file_bucket_file end diff --git a/lib/puppet/face/help.rb b/lib/puppet/face/help.rb index a762fb02e..ba64d2b54 100644 --- a/lib/puppet/face/help.rb +++ b/lib/puppet/face/help.rb @@ -1,130 +1,133 @@ require 'puppet/face' require 'puppet/util/command_line' require 'pathname' require 'erb' Puppet::Face.define(:help, '0.0.1') do + copyright "Puppet Labs", 2011 + license "Apache 2 license; see COPYING" + summary "Displays help about puppet subcommands" action(:help) do summary "Display help about faces and their actions." option "--version VERSION" do desc "Which version of the interface to show help for" end default when_invoked do |*args| # Check our invocation, because we want varargs and can't do defaults # yet. REVISIT: when we do option defaults, and positional options, we # should rewrite this to use those. --daniel 2011-04-04 options = args.pop if options.nil? or args.length > 2 then if args.select { |x| x == 'help' }.length > 2 then c = "\n !\"'),-./7:; detail puts detail.backtrace if Puppet[:trace] Puppet.err "Could not send report: #{detail}" end end end end diff --git a/lib/puppet/face/resource.rb b/lib/puppet/face/resource.rb index 908b2e462..55a14f280 100644 --- a/lib/puppet/face/resource.rb +++ b/lib/puppet/face/resource.rb @@ -1,5 +1,8 @@ require 'puppet/face/indirector' Puppet::Face::Indirector.define(:resource, '0.0.1') do + copyright "Puppet Labs", 2011 + license "Apache 2 license; see COPYING" + summary "Interact directly with resources via the RAL, like ralsh" end diff --git a/lib/puppet/face/resource_type.rb b/lib/puppet/face/resource_type.rb index fe86eb873..8776dc105 100644 --- a/lib/puppet/face/resource_type.rb +++ b/lib/puppet/face/resource_type.rb @@ -1,5 +1,8 @@ require 'puppet/face/indirector' Puppet::Face::Indirector.define(:resource_type, '0.0.1') do + copyright "Puppet Labs", 2011 + license "Apache 2 license; see COPYING" + summary "View resource types, classes, and nodes from all manifests" end diff --git a/lib/puppet/face/secret_agent.rb b/lib/puppet/face/secret_agent.rb index 90841b9e0..50018cb13 100644 --- a/lib/puppet/face/secret_agent.rb +++ b/lib/puppet/face/secret_agent.rb @@ -1,21 +1,24 @@ require 'puppet/face' Puppet::Face.define(:secret_agent, '0.0.1') do + copyright "Puppet Labs", 2011 + license "Apache 2 license; see COPYING" + summary "Provides agent-like behavior, with no plugin downloading or reporting." action(:synchronize) do summary "run the secret agent, which makes the catalog and system match..." when_invoked do |certname, options| Puppet::Face[:plugin, '0.0.1'].download facts = Puppet::Face[:facts, '0.0.1'].find(certname) catalog = Puppet::Face[:catalog, '0.0.1'].download(certname, facts) report = Puppet::Face[:catalog, '0.0.1'].apply(catalog) Puppet::Face[:report, '0.0.1'].submit(report) return report end end end diff --git a/lib/puppet/face/status.rb b/lib/puppet/face/status.rb index 2a0956ee3..d35d7e1b3 100644 --- a/lib/puppet/face/status.rb +++ b/lib/puppet/face/status.rb @@ -1,5 +1,8 @@ require 'puppet/face/indirector' Puppet::Face::Indirector.define(:status, '0.0.1') do + copyright "Puppet Labs", 2011 + license "Apache 2 license; see COPYING" + summary "View status information" end