summaryrefslogtreecommitdiffstats
path: root/lib/puppet/face/certificate_request.rb
blob: de52b7fb73f2efdffc1852d4175cac8bc8b2d23d (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
require 'puppet/indirector/face'

Puppet::Indirector::Face.define(:certificate_request, '0.0.1') do
  copyright "Puppet Labs", 2011
  license   "Apache 2 license; see COPYING"

  summary "Manage certificate requests."
  description <<-'EOT'
    Retrieves and submits certificate signing requests (CSRs). Invoke
    `search` with a dummy key to retrieve all outstanding CSRs, invoke
    `find` with a node certificate name to retrieve a specific request, and
    invoke `save` to submit a CSR.
  EOT
  notes <<-'EOT'
    This is an indirector face, which exposes `find`, `search`, `save`, and
    `destroy` actions for an indirected subsystem of Puppet. Valid termini
    for this face include:

    * `ca`
    * `file`
    * `rest`
  EOT

  # Per-action doc overrides
  get_action(:destroy).summary "Invalid for this face."

  get_action(:find).summary "Retrieve a single CSR."
  get_action(:find).arguments "<host>"
  get_action(:find).returns <<-'EOT'
    A single certificate request. In most cases, you will want to render
    this as a string ('--render-as s').
  EOT
  get_action(:find).examples <<-'EOT'
    Retrieve a single CSR from the puppet master's CA:

    $ puppet certificate_request find somenode.puppetlabs.lan --terminus rest
  EOT

  get_action(:search).summary "Retrieve all outstanding CSRs."
  get_action(:search).arguments "<dummy_key>"
  get_action(:search).returns <<-'EOT'
    An array of certificate request objects. In most cases, you will
    want to render this as a string ('--render-as s').
  EOT
  get_action(:search).notes "This action always returns all CSRs, but requires a dummy search key."
  get_action(:search).examples <<-'EOT'
    Retrieve all CSRs from the local CA:

    $ puppet certificate_request search x --terminus ca
  EOT

  get_action(:save).summary "Submit a certificate signing request."
  get_action(:save).arguments "<x509_CSR>"
end