Created
March 29, 2010 22:43
-
-
Save lak/348511 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/lib/puppet/indirector/certificate_request/ca.rb b/lib/puppet/indirector/certificate_request/ca.rb | |
| index e90f43a..6c41e6a 100644 | |
| --- a/lib/puppet/indirector/certificate_request/ca.rb | |
| +++ b/lib/puppet/indirector/certificate_request/ca.rb | |
| @@ -9,6 +9,15 @@ class Puppet::SSL::CertificateRequest::Ca < Puppet::Indirector::SslFile | |
| def save(request) | |
| result = super | |
| Puppet.notice "%s has a waiting certificate request" % request.key | |
| + if cert = Puppet::SSL::Certificate.find(request.key) | |
| + we_would_autosign = ["true",true].include?(Puppet[:autosign]) or Puppet::Network::AuthStore.new(Puppet[:autosign]).allowed?(host) | |
| + if ["true",true].inclide?(Puppet[:replace_certs]) or (Puppet[:replace_certs].empty? and we_would_autosign) | |
| + Puppet.notice "Removing previously signed certificate #{certfile} for #{host}" | |
| + cert.destroy | |
| + else | |
| + Puppet.warn "Certificate request for #{request.key} received but we already have signed a certificate" | |
| + end | |
| + end | |
| result | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment