blob: 2615e3d8699747321bb99a9a2aadfff9e5e2c17a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
require 'puppet/interface/indirector'
require 'puppet/ssl/host'
Puppet::Interface::Indirector.define(:certificate, '0.0.1') do
action :generate do
invoke do |name|
host = Puppet::SSL::Host.new(name)
host.generate_certificate_request
host.certificate_request.class.indirection.save(host.certificate_request)
end
end
action :list do
invoke do
Puppet::SSL::Host.indirection.search("*", {
:for => :certificate_request,
}).map { |h| h.inspect }
end
end
action :sign do
invoke do |name|
Puppet::SSL::Host.indirection.save(Puppet::SSL::Host.new(name))
end
end
end
|