diff options
author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-04-26 17:32:36 +0000 |
---|---|---|
committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-04-26 17:32:36 +0000 |
commit | a78bf1ee71dd3a0930ad5f7277f7c50dc66fa55d (patch) | |
tree | 7a9582be8f87d35d21f7a735b0425f7e3cc17dd1 /lib | |
parent | bda8e52a02d77c39cd96ea02352c0067a57135e7 (diff) | |
download | puppet-a78bf1ee71dd3a0930ad5f7277f7c50dc66fa55d.tar.gz puppet-a78bf1ee71dd3a0930ad5f7277f7c50dc66fa55d.tar.xz puppet-a78bf1ee71dd3a0930ad5f7277f7c50dc66fa55d.zip |
adding "clean" mode to puppetca
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1140 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib')
-rw-r--r-- | lib/puppet/sslcertificates/ca.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/puppet/sslcertificates/ca.rb b/lib/puppet/sslcertificates/ca.rb index aacf3352c..4e4cd8ba8 100644 --- a/lib/puppet/sslcertificates/ca.rb +++ b/lib/puppet/sslcertificates/ca.rb @@ -70,6 +70,26 @@ class Puppet::SSLCertificates::CA @config[:cacert] end + # Remove all traces of a given host. This is kind of hackish, but, eh. + def clean(host) + [:csrdir, :signeddir, :publickeydir, :privatekeydir, :certdir].each do |name| + dir = Puppet[name] + + file = File.join(dir, host + ".pem") + + if FileTest.exists?(file) + begin + puts "Removing %s" % file + File.unlink(file) + rescue => detail + raise Puppet::Error, "Could not delete %s: %s" % + [file, detail] + end + end + + end + end + def host2csrfile(hostname) File.join(Puppet[:csrdir], [hostname, "pem"].join(".")) end |