diff options
| author | Jesse Wolfe <jes5199@gmail.com> | 2010-04-20 14:15:06 -0700 |
|---|---|---|
| committer | test branch <puppet-dev@googlegroups.com> | 2010-02-17 06:50:53 -0800 |
| commit | 6bdda8c65e55fcdab896cee9985bca3593c66c95 (patch) | |
| tree | 1296965e3b7290ad1990d36aff87f3dc758caee8 /lib/puppet/application/ca.rb | |
| parent | f9783fcdee928c80339b2b1567350b2450e1ea05 (diff) | |
| download | puppet-6bdda8c65e55fcdab896cee9985bca3593c66c95.tar.gz puppet-6bdda8c65e55fcdab896cee9985bca3593c66c95.tar.xz puppet-6bdda8c65e55fcdab896cee9985bca3593c66c95.zip | |
feature #2276 Single Executable: "puppet cert"
Add "puppet cert" as the new invocation of "puppetca"
Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
Diffstat (limited to 'lib/puppet/application/ca.rb')
| -rw-r--r-- | lib/puppet/application/ca.rb | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/lib/puppet/application/ca.rb b/lib/puppet/application/ca.rb deleted file mode 100644 index ab7f607ee..000000000 --- a/lib/puppet/application/ca.rb +++ /dev/null @@ -1,76 +0,0 @@ -require 'puppet' -require 'puppet/application' -require 'puppet/ssl/certificate_authority' - -Puppet::Application.new(:ca) do - - should_parse_config - - attr_accessor :mode, :all, :ca, :digest - - def find_mode(opt) - modes = Puppet::SSL::CertificateAuthority::Interface::INTERFACE_METHODS - tmp = opt.sub("--", '').to_sym - @mode = modes.include?(tmp) ? tmp : nil - end - - option("--clean", "-c") do - @mode = :destroy - end - - option("--all", "-a") do - @all = true - end - - option("--digest DIGEST") do |arg| - @digest = arg - end - - option("--debug", "-d") do |arg| - Puppet::Util::Log.level = :debug - end - - Puppet::SSL::CertificateAuthority::Interface::INTERFACE_METHODS.reject {|m| m == :destroy }.each do |method| - option("--#{method}", "-%s" % method.to_s[0,1] ) do - find_mode("--#{method}") - end - end - - option("--verbose", "-v") do - Puppet::Util::Log.level = :info - end - - command(:main) do - if @all - hosts = :all - else - hosts = ARGV.collect { |h| puts h; h.downcase } - end - begin - @ca.apply(:revoke, :to => hosts) if @mode == :destroy - @ca.apply(@mode, :to => hosts, :digest => @digest) - rescue => detail - puts detail.backtrace if Puppet[:trace] - puts detail.to_s - exit(24) - end - end - - setup do - if Puppet.settings.print_configs? - exit(Puppet.settings.print_configs ? 0 : 1) - end - - Puppet::Util::Log.newdestination :console - - Puppet::SSL::Host.ca_location = :only - - begin - @ca = Puppet::SSL::CertificateAuthority.new - rescue => detail - puts detail.backtrace if Puppet[:trace] - puts detail.to_s - exit(23) - end - end -end |
