Remove the public key, in addition to the private key
# File lib/puppet/indirector/key/file.rb, line 20 def destroy(request) super return unless FileTest.exist?(public_key_path(request.key)) begin File.unlink(public_key_path(request.key)) rescue => detail raise Puppet::Error, "Could not remove #{request.key} public key: #{detail}" end end
Where should we store the public key?
# File lib/puppet/indirector/key/file.rb, line 11 def public_key_path(name) if ca?(name) Puppet[:capub] else File.join(Puppet[:publickeydir], name.to_s + ".pem") end end
Save the public key, in addition to the private key.
# File lib/puppet/indirector/key/file.rb, line 33 def save(request) super begin Puppet.settings.writesub(:publickeydir, public_key_path(request.key)) { |f| f.print request.instance.content.public_key.to_pem } rescue => detail raise Puppet::Error, "Could not write #{request.key}: #{detail}" end end