summaryrefslogtreecommitdiffstats
path: root/lib/puppet/interface
diff options
context:
space:
mode:
authorRichard Crowley <r@rcrowley.org>2011-03-23 17:45:46 +0000
committerRichard Crowley <r@rcrowley.org>2011-03-23 17:45:46 +0000
commit961c7163f336c0dd96f7f72122af9155e1a2260a (patch)
treee1f5d044600492cff56d0de1eda4df1157799b7b /lib/puppet/interface
parenta7a9e125018c7a3fd0f0afc543f7aeaea1c19525 (diff)
downloadpuppet-961c7163f336c0dd96f7f72122af9155e1a2260a.tar.gz
puppet-961c7163f336c0dd96f7f72122af9155e1a2260a.tar.xz
puppet-961c7163f336c0dd96f7f72122af9155e1a2260a.zip
Added list action.
The common tasks of checking the --ca-location argument and becoming a CA process if necessary (that is, acting like a master) have been abstracted into the Application where they belong.
Diffstat (limited to 'lib/puppet/interface')
-rw-r--r--lib/puppet/interface/certificate.rb22
1 files changed, 10 insertions, 12 deletions
diff --git a/lib/puppet/interface/certificate.rb b/lib/puppet/interface/certificate.rb
index 4088a4557..5c06cdc29 100644
--- a/lib/puppet/interface/certificate.rb
+++ b/lib/puppet/interface/certificate.rb
@@ -11,21 +11,19 @@ Puppet::Interface::Indirector.interface(:certificate) do
end
end
- action :sign do |name|
- invoke do |name|
- unless Puppet::SSL::Host.ca_location
- raise ArgumentError, "You must have a CA location specified; use --ca-location to specify the location (remote, local, only)"
- end
-
- location = Puppet::SSL::Host.ca_location
- if location == :local && !Puppet::SSL::CertificateAuthority.ca?
- app = Puppet::Application[:certificate]
- app.class.run_mode("master")
- app.set_run_mode Puppet::Application[:certificate].class.run_mode
+ action :list do
+ invoke do
+ Puppet::SSL::Host.indirection.search("*").each do |host|
+ puts host.inspect
end
+ nil
+ end
+ end
+ action :sign do |name|
+ invoke do |name|
Puppet::SSL::Host.indirection.save(Puppet::SSL::Host.new(name))
-
end
end
+
end