puppet 2.7.1 → 2.7.3

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of puppet might be problematic. Click here for more details.

Files changed (171) hide show
  1. data/CHANGELOG +225 -1
  2. data/CONTRIBUTING.md +299 -0
  3. data/README.md +0 -1
  4. data/conf/redhat/puppet.spec +132 -25
  5. data/conf/solaris/pkginfo +1 -1
  6. data/conf/suse/puppet.spec +5 -2
  7. data/ext/envpuppet +56 -3
  8. data/ext/vim/README +2 -1
  9. data/ext/vim/ftplugin/puppet.vim +94 -0
  10. data/ext/vim/indent/puppet.vim +76 -0
  11. data/lib/puppet.rb +2 -3
  12. data/lib/puppet/application/agent.rb +7 -7
  13. data/lib/puppet/application/apply.rb +20 -8
  14. data/lib/puppet/application/ca.rb +5 -0
  15. data/lib/puppet/application/cert.rb +2 -1
  16. data/lib/puppet/application/certificate.rb +0 -5
  17. data/lib/puppet/application/device.rb +4 -4
  18. data/lib/puppet/application/doc.rb +23 -12
  19. data/lib/puppet/application/face_base.rb +2 -1
  20. data/lib/puppet/application/inspect.rb +5 -2
  21. data/lib/puppet/configurer.rb +60 -56
  22. data/lib/puppet/configurer/fact_handler.rb +6 -1
  23. data/lib/puppet/defaults.rb +20 -1
  24. data/lib/puppet/face/ca.rb +233 -0
  25. data/lib/puppet/face/certificate.rb +15 -11
  26. data/lib/puppet/face/certificate_request.rb +9 -11
  27. data/lib/puppet/face/certificate_revocation_list.rb +5 -7
  28. data/lib/puppet/face/node/clean.rb +154 -0
  29. data/lib/puppet/face/status.rb +1 -0
  30. data/lib/puppet/file_serving/configuration/parser.rb +6 -13
  31. data/lib/puppet/indirector/exec.rb +3 -3
  32. data/lib/puppet/indirector/face.rb +17 -7
  33. data/lib/puppet/indirector/report/processor.rb +29 -16
  34. data/lib/puppet/indirector/rest.rb +42 -7
  35. data/lib/puppet/indirector/yaml.rb +5 -0
  36. data/lib/puppet/interface.rb +7 -2
  37. data/lib/puppet/interface/action.rb +57 -23
  38. data/lib/puppet/interface/action_manager.rb +10 -5
  39. data/lib/puppet/interface/face_collection.rb +43 -52
  40. data/lib/puppet/interface/option.rb +19 -0
  41. data/lib/puppet/interface/option_builder.rb +13 -0
  42. data/lib/puppet/interface/option_manager.rb +2 -1
  43. data/lib/puppet/metatype/manager.rb +7 -20
  44. data/lib/puppet/module.rb +4 -1
  45. data/lib/puppet/network/authconfig.rb +3 -1
  46. data/lib/puppet/network/authstore.rb +14 -5
  47. data/lib/puppet/network/handler/fileserver.rb +3 -0
  48. data/lib/puppet/network/http/webrick.rb +1 -1
  49. data/lib/puppet/network/rest_authconfig.rb +6 -1
  50. data/lib/puppet/network/rest_authorization.rb +1 -1
  51. data/lib/puppet/parser/compiler.rb +8 -11
  52. data/lib/puppet/parser/functions.rb +1 -6
  53. data/lib/puppet/parser/functions/create_resources.rb +6 -5
  54. data/lib/puppet/parser/functions/regsubst.rb +26 -0
  55. data/lib/puppet/parser/functions/shellquote.rb +26 -0
  56. data/lib/puppet/parser/functions/sprintf.rb +26 -0
  57. data/lib/puppet/parser/grammar.ra +34 -60
  58. data/lib/puppet/parser/lexer.rb +5 -5
  59. data/lib/puppet/parser/parser.rb +913 -1196
  60. data/lib/puppet/parser/resource.rb +18 -1
  61. data/lib/puppet/parser/scope.rb +2 -2
  62. data/lib/puppet/provider/augeas/augeas.rb +42 -17
  63. data/lib/puppet/provider/mount/parsed.rb +19 -1
  64. data/lib/puppet/provider/naginator.rb +9 -1
  65. data/lib/puppet/provider/nameservice/directoryservice.rb +11 -8
  66. data/lib/puppet/provider/network_device.rb +1 -1
  67. data/lib/puppet/provider/package/aptitude.rb +1 -0
  68. data/lib/puppet/provider/package/pacman.rb +94 -0
  69. data/lib/puppet/provider/ssh_authorized_key/parsed.rb +0 -6
  70. data/lib/puppet/rails/host.rb +7 -0
  71. data/lib/puppet/reports/store.rb +15 -0
  72. data/lib/puppet/resource/catalog.rb +15 -6
  73. data/lib/puppet/ssl/certificate.rb +6 -0
  74. data/lib/puppet/ssl/inventory.rb +2 -0
  75. data/lib/puppet/transaction.rb +9 -17
  76. data/lib/puppet/transaction/report.rb +3 -3
  77. data/lib/puppet/type.rb +13 -24
  78. data/lib/puppet/type/file.rb +8 -2
  79. data/lib/puppet/type/file/source.rb +2 -2
  80. data/lib/puppet/type/service.rb +20 -24
  81. data/lib/puppet/type/ssh_authorized_key.rb +12 -0
  82. data/lib/puppet/type/user.rb +8 -0
  83. data/lib/puppet/util.rb +0 -1
  84. data/lib/puppet/util/network_device.rb +3 -3
  85. data/lib/puppet/util/settings.rb +1 -1
  86. data/lib/puppet/util/settings/file_setting.rb +1 -0
  87. data/lib/semver.rb +65 -0
  88. data/spec/integration/defaults_spec.rb +23 -1
  89. data/spec/integration/network/rest_authconfig_spec.rb +145 -0
  90. data/spec/integration/node/facts_spec.rb +1 -1
  91. data/spec/integration/parser/functions_spec.rb +1 -1
  92. data/spec/integration/parser/parser_spec.rb +31 -0
  93. data/spec/integration/provider/ssh_authorized_key_spec.rb +207 -0
  94. data/spec/integration/type_spec.rb +11 -0
  95. data/spec/lib/puppet/face/1.0.0/huzzah.rb +8 -0
  96. data/spec/lib/puppet/face/huzzah.rb +1 -0
  97. data/spec/lib/puppet/face/huzzah/obsolete.rb +6 -0
  98. data/spec/shared_behaviours/things_that_declare_options.rb +115 -3
  99. data/spec/unit/application/agent_spec.rb +2 -2
  100. data/spec/unit/application/apply_spec.rb +74 -56
  101. data/spec/unit/application/cert_spec.rb +10 -0
  102. data/spec/unit/application/device_spec.rb +2 -3
  103. data/spec/unit/application/face_base_spec.rb +1 -0
  104. data/spec/unit/application/facts_spec.rb +1 -0
  105. data/spec/unit/application/inspect_spec.rb +5 -0
  106. data/spec/unit/configurer/fact_handler_spec.rb +45 -37
  107. data/spec/unit/configurer_spec.rb +405 -327
  108. data/spec/unit/face/ca_spec.rb +355 -0
  109. data/spec/unit/face/certificate_spec.rb +16 -4
  110. data/spec/unit/face/node_spec.rb +261 -1
  111. data/spec/unit/file_serving/configuration/parser_spec.rb +8 -0
  112. data/spec/unit/indirector/certificate/rest_spec.rb +1 -0
  113. data/spec/unit/indirector/certificate_status/file_spec.rb +4 -0
  114. data/spec/unit/indirector/exec_spec.rb +4 -4
  115. data/spec/unit/indirector/face_spec.rb +3 -1
  116. data/spec/unit/indirector/facts/couch_spec.rb +2 -2
  117. data/spec/unit/indirector/facts/network_device_spec.rb +2 -6
  118. data/spec/unit/indirector/node/exec_spec.rb +1 -1
  119. data/spec/unit/indirector/report/processor_spec.rb +31 -8
  120. data/spec/unit/indirector/rest_spec.rb +53 -5
  121. data/spec/unit/indirector/yaml_spec.rb +18 -0
  122. data/spec/unit/interface/action_spec.rb +112 -8
  123. data/spec/unit/interface/face_collection_spec.rb +46 -36
  124. data/spec/unit/interface/option_spec.rb +44 -0
  125. data/spec/unit/interface_spec.rb +11 -6
  126. data/spec/unit/module_spec.rb +38 -9
  127. data/spec/unit/network/authconfig_spec.rb +23 -0
  128. data/spec/unit/network/authstore_spec.rb +36 -4
  129. data/spec/unit/network/handler/fileserver_spec.rb +32 -0
  130. data/spec/unit/network/rest_authconfig_spec.rb +1 -1
  131. data/spec/unit/node_spec.rb +1 -0
  132. data/spec/unit/parser/compiler_spec.rb +8 -46
  133. data/spec/unit/parser/lexer_spec.rb +27 -17
  134. data/spec/unit/parser/resource_spec.rb +61 -3
  135. data/spec/unit/parser/scope_spec.rb +5 -1
  136. data/spec/unit/provider/augeas/augeas_spec.rb +106 -1
  137. data/spec/unit/provider/cisco_spec.rb +3 -4
  138. data/spec/unit/provider/interface/cisco_spec.rb +1 -2
  139. data/spec/unit/provider/mount/parsed_spec.rb +41 -0
  140. data/spec/unit/provider/nameservice/directoryservice_spec.rb +60 -0
  141. data/spec/unit/provider/network_device_spec.rb +1 -2
  142. data/spec/unit/provider/package/pacman_spec.rb +237 -0
  143. data/spec/unit/provider/package/pkgutil_spec.rb +2 -3
  144. data/spec/unit/provider/ssh_authorized_key/parsed_spec.rb +21 -32
  145. data/spec/unit/provider/vlan/cisco_spec.rb +1 -2
  146. data/spec/unit/rails/host_spec.rb +8 -0
  147. data/spec/unit/resource/catalog_spec.rb +55 -8
  148. data/spec/unit/semver_spec.rb +187 -0
  149. data/spec/unit/ssl/certificate_spec.rb +25 -0
  150. data/spec/unit/transaction/report_spec.rb +3 -3
  151. data/spec/unit/transaction_spec.rb +8 -2
  152. data/spec/unit/type/file_spec.rb +57 -0
  153. data/spec/unit/type/interface_spec.rb +1 -2
  154. data/spec/unit/type/schedule_spec.rb +73 -42
  155. data/spec/unit/type/ssh_authorized_key_spec.rb +180 -70
  156. data/spec/unit/type/user_spec.rb +8 -0
  157. data/spec/unit/type/vlan_spec.rb +1 -2
  158. data/spec/unit/type_spec.rb +66 -0
  159. data/spec/unit/util/network_device/cisco/device_spec.rb +1 -2
  160. data/spec/unit/util/network_device/cisco/facts_spec.rb +2 -3
  161. data/spec/unit/util/network_device/cisco/interface_spec.rb +1 -2
  162. data/spec/unit/util/network_device/config_spec.rb +3 -4
  163. data/spec/unit/util/network_device/ipcalc_spec.rb +1 -2
  164. data/spec/unit/util/network_device/transport/base_spec.rb +1 -2
  165. data/spec/unit/util/network_device/transport/ssh_spec.rb +1 -2
  166. data/spec/unit/util/network_device/transport/telnet_spec.rb +1 -2
  167. data/spec/unit/util/network_device_spec.rb +2 -2
  168. data/spec/unit/util/settings/file_setting_spec.rb +4 -0
  169. data/spec/unit/util/settings_spec.rb +11 -0
  170. data/test/lib/puppettest/railstesting.rb +0 -34
  171. metadata +19 -4
@@ -16,7 +16,12 @@ module Puppet::Configurer::FactHandler
16
16
  # compile them and then "cache" them on the server.
17
17
  begin
18
18
  reload_facter
19
- Puppet::Node::Facts.indirection.find(Puppet[:certname])
19
+ facts = Puppet::Node::Facts.indirection.find(Puppet[:node_name_value])
20
+ unless Puppet[:node_name_fact].empty?
21
+ Puppet[:node_name_value] = facts.values[Puppet[:node_name_fact]]
22
+ facts.name = Puppet[:node_name_value]
23
+ end
24
+ facts
20
25
  rescue SystemExit,NoMemoryError
21
26
  raise
22
27
  rescue Exception => detail
@@ -466,7 +466,7 @@ module Puppet
466
466
  :desc => "The directory in which to store reports
467
467
  received from the client. Each client gets a separate
468
468
  subdirectory."},
469
- :reporturl => ["http://localhost:3000/reports",
469
+ :reporturl => ["http://localhost:3000/reports/upload",
470
470
  "The URL used by the http reports processor to send reports"],
471
471
  :fileserverconfig => ["$confdir/fileserver.conf", "Where the fileserver configuration is stored."],
472
472
  :strict_hostname_checking => [false, "Whether to only search for the complete
@@ -493,6 +493,25 @@ module Puppet
493
493
  )
494
494
 
495
495
  setdefaults(:agent,
496
+ :node_name_value => { :default => "$certname",
497
+ :desc => "The explicit value used for the node name for all requests the agent
498
+ makes to the master. WARNING: This setting is mutually exclusive with
499
+ node_name_fact. Changing this setting also requires changes to the default
500
+ auth.conf configuration on the Puppet Master. Please see
501
+ http://links.puppetlabs.com/node_name_value for more information."
502
+ },
503
+ :node_name_fact => { :default => "",
504
+ :desc => "The fact name used to determine the node name used for all requests the agent
505
+ makes to the master. WARNING: This setting is mutually exclusive with
506
+ node_name_value. Changing this setting also requires changes to the default
507
+ auth.conf configuration on the Puppet Master. Please see
508
+ http://links.puppetlabs.com/node_name_fact for more information.",
509
+ :hook => proc do |value|
510
+ if !value.empty? and Puppet[:node_name_value] != Puppet[:certname]
511
+ raise "Cannot specify both the node_name_value and node_name_fact settings"
512
+ end
513
+ end
514
+ },
496
515
  :localconfig => { :default => "$statedir/localconfig",
497
516
  :owner => "root",
498
517
  :mode => 0660,
@@ -0,0 +1,233 @@
1
+ require 'puppet/face'
2
+
3
+ Puppet::Face.define(:ca, '0.1.0') do
4
+ copyright "Puppet Labs", 2011
5
+ license "Apache 2 license; see COPYING"
6
+
7
+ summary "Local Puppet Certificate Authority management."
8
+
9
+ description <<-TEXT
10
+ This provides local management of the Puppet Certificate Authority.
11
+
12
+ You can use this subcommand to sign outstanding certificate requests, list
13
+ and manage local certificates, and inspect the state of the CA.
14
+ TEXT
15
+
16
+ action :list do
17
+ summary "List certificates and/or certificate requests."
18
+
19
+ description <<-TEXT
20
+ This will list the current certificates and certificate signing requests
21
+ in the Puppet CA. You will also get the fingerprint, and any certificate
22
+ verification failure reported.
23
+ TEXT
24
+
25
+ option "--[no-]all" do
26
+ summary "Include all certificates and requests."
27
+ end
28
+
29
+ option "--[no-]pending" do
30
+ summary "Include pending certificate signing requests."
31
+ end
32
+
33
+ option "--[no-]signed" do
34
+ summary "Include signed certificates."
35
+ end
36
+
37
+ option "--subject PATTERN" do
38
+ summary "Only list if the subject matches PATTERN."
39
+
40
+ description <<-TEXT
41
+ Only include certificates or requests where subject matches PATTERN.
42
+
43
+ PATTERN is interpreted as a regular expression, allowing complex
44
+ filtering of the content.
45
+ TEXT
46
+ end
47
+
48
+ when_invoked do |options|
49
+ raise "Not a CA" unless Puppet::SSL::CertificateAuthority.ca?
50
+ unless ca = Puppet::SSL::CertificateAuthority.instance
51
+ raise "Unable to fetch the CA"
52
+ end
53
+
54
+ pattern = options[:subject].nil? ? nil :
55
+ Regexp.new(options[:subject], Regexp::IGNORECASE)
56
+
57
+ pending = options[:pending].nil? ? options[:all] : options[:pending]
58
+ signed = options[:signed].nil? ? options[:all] : options[:signed]
59
+
60
+ # By default we list pending, so if nothing at all was requested...
61
+ unless pending or signed then pending = true end
62
+
63
+ hosts = []
64
+
65
+ pending and hosts += ca.waiting?
66
+ signed and hosts += ca.list
67
+
68
+ pattern and hosts = hosts.select {|hostname| pattern.match hostname }
69
+
70
+ hosts.sort.map {|host| Puppet::SSL::Host.new(host) }
71
+ end
72
+
73
+ when_rendering :console do |hosts|
74
+ unless ca = Puppet::SSL::CertificateAuthority.instance
75
+ raise "Unable to fetch the CA"
76
+ end
77
+
78
+ length = hosts.map{|x| x.name.length }.max + 1
79
+
80
+ hosts.map do |host|
81
+ name = host.name.ljust(length)
82
+ if host.certificate_request then
83
+ " #{name} (#{host.certificate_request.fingerprint})"
84
+ else
85
+ begin
86
+ ca.verify(host.certificate)
87
+ "+ #{name} (#{host.certificate.fingerprint})"
88
+ rescue Puppet::SSL::CertificateAuthority::CertificateVerificationError => e
89
+ "- #{name} (#{host.certificate.fingerprint}) (#{e.to_s})"
90
+ end
91
+ end
92
+ end.join("\n")
93
+ end
94
+ end
95
+
96
+ action :destroy do
97
+ when_invoked do |host, options|
98
+ raise "Not a CA" unless Puppet::SSL::CertificateAuthority.ca?
99
+ unless ca = Puppet::SSL::CertificateAuthority.instance
100
+ raise "Unable to fetch the CA"
101
+ end
102
+
103
+ ca.destroy host
104
+ end
105
+ end
106
+
107
+ action :revoke do
108
+ when_invoked do |host, options|
109
+ raise "Not a CA" unless Puppet::SSL::CertificateAuthority.ca?
110
+ unless ca = Puppet::SSL::CertificateAuthority.instance
111
+ raise "Unable to fetch the CA"
112
+ end
113
+
114
+ begin
115
+ ca.revoke host
116
+ rescue ArgumentError => e
117
+ # This is a bit naff, but it makes the behaviour consistent with the
118
+ # destroy action. The underlying tools could be nicer for that sort
119
+ # of thing; they have fairly inconsistent reporting of failures.
120
+ raise unless e.to_s =~ /Could not find a serial number for /
121
+ "Nothing was revoked"
122
+ end
123
+ end
124
+ end
125
+
126
+ action :generate do
127
+ when_invoked do |host, options|
128
+ raise "Not a CA" unless Puppet::SSL::CertificateAuthority.ca?
129
+ unless ca = Puppet::SSL::CertificateAuthority.instance
130
+ raise "Unable to fetch the CA"
131
+ end
132
+
133
+ begin
134
+ ca.generate host
135
+ rescue RuntimeError => e
136
+ if e.to_s =~ /already has a requested certificate/
137
+ "#{host} already has a certificate request; use sign instead"
138
+ else
139
+ raise
140
+ end
141
+ rescue ArgumentError => e
142
+ if e.to_s =~ /A Certificate already exists for /
143
+ "#{host} already has a certificate"
144
+ else
145
+ raise
146
+ end
147
+ end
148
+ end
149
+ end
150
+
151
+ action :sign do
152
+ when_invoked do |host, options|
153
+ raise "Not a CA" unless Puppet::SSL::CertificateAuthority.ca?
154
+ unless ca = Puppet::SSL::CertificateAuthority.instance
155
+ raise "Unable to fetch the CA"
156
+ end
157
+
158
+ begin
159
+ ca.sign host
160
+ rescue ArgumentError => e
161
+ if e.to_s =~ /Could not find certificate request/
162
+ e.to_s
163
+ else
164
+ raise
165
+ end
166
+ end
167
+ end
168
+ end
169
+
170
+ action :print do
171
+ when_invoked do |host, options|
172
+ raise "Not a CA" unless Puppet::SSL::CertificateAuthority.ca?
173
+ unless ca = Puppet::SSL::CertificateAuthority.instance
174
+ raise "Unable to fetch the CA"
175
+ end
176
+
177
+ ca.print host
178
+ end
179
+ end
180
+
181
+ action :fingerprint do
182
+ option "--digest ALGORITHM" do
183
+ summary "The hash algorithm to use when displaying the fingerprint"
184
+ end
185
+
186
+ when_invoked do |host, options|
187
+ raise "Not a CA" unless Puppet::SSL::CertificateAuthority.ca?
188
+ unless ca = Puppet::SSL::CertificateAuthority.instance
189
+ raise "Unable to fetch the CA"
190
+ end
191
+
192
+ begin
193
+ # I want the default from the CA, not to duplicate it, but passing
194
+ # 'nil' explicitly means that we don't get that. This works...
195
+ if options.has_key? :digest
196
+ ca.fingerprint host, options[:digest]
197
+ else
198
+ ca.fingerprint host
199
+ end
200
+ rescue ArgumentError => e
201
+ raise unless e.to_s =~ /Could not find a certificate or csr for/
202
+ nil
203
+ end
204
+ end
205
+ end
206
+
207
+ action :verify do
208
+ when_invoked do |host, options|
209
+ raise "Not a CA" unless Puppet::SSL::CertificateAuthority.ca?
210
+ unless ca = Puppet::SSL::CertificateAuthority.instance
211
+ raise "Unable to fetch the CA"
212
+ end
213
+
214
+ begin
215
+ ca.verify host
216
+ { :host => host, :valid => true }
217
+ rescue ArgumentError => e
218
+ raise unless e.to_s =~ /Could not find a certificate for/
219
+ { :host => host, :valid => false, :error => e.to_s }
220
+ rescue Puppet::SSL::CertificateAuthority::CertificateVerificationError => e
221
+ { :host => host, :valid => false, :error => e.to_s }
222
+ end
223
+ end
224
+
225
+ when_rendering :console do |value|
226
+ if value[:valid]
227
+ nil
228
+ else
229
+ "Could not verify #{value[:host]}: #{value[:error]}"
230
+ end
231
+ end
232
+ end
233
+ end
@@ -6,7 +6,7 @@ Puppet::Indirector::Face.define(:certificate, '0.0.1') do
6
6
  license "Apache 2 license; see COPYING"
7
7
 
8
8
  summary "Provide access to the CA for certificate management."
9
- description <<-'EOT'
9
+ description <<-EOT
10
10
  This subcommand interacts with a local or remote Puppet certificate
11
11
  authority. Currently, its behavior is not a full superset of `puppet
12
12
  cert`; specifically, it is unable to mimic puppet cert's "clean" option,
@@ -15,8 +15,9 @@ Puppet::Indirector::Face.define(:certificate, '0.0.1') do
15
15
  EOT
16
16
 
17
17
  option "--ca-location LOCATION" do
18
+ required
18
19
  summary "Which certificate authority to use (local or remote)."
19
- description <<-'EOT'
20
+ description <<-EOT
20
21
  Whether to act on the local certificate authority or one provided by a
21
22
  remote puppet master. Allowed values are 'local' and 'remote.'
22
23
 
@@ -24,6 +25,9 @@ Puppet::Indirector::Face.define(:certificate, '0.0.1') do
24
25
  EOT
25
26
 
26
27
  before_action do |action, args, options|
28
+ unless [:remote, :local, :only].include? options[:ca_location].to_sym
29
+ raise ArgumentError, "Valid values for ca-location are 'remote', 'local', 'only'."
30
+ end
27
31
  Puppet::SSL::Host.ca_location = options[:ca_location].to_sym
28
32
  end
29
33
  end
@@ -32,7 +36,7 @@ Puppet::Indirector::Face.define(:certificate, '0.0.1') do
32
36
  summary "Generate a new certificate signing request."
33
37
  arguments "<host>"
34
38
  returns "Nothing."
35
- description <<-'EOT'
39
+ description <<-EOT
36
40
  Generates and submits a certificate signing request (CSR) for the
37
41
  specified host. This CSR will then have to be signed by a user
38
42
  with the proper authorization on the certificate authority.
@@ -41,7 +45,7 @@ Puppet::Indirector::Face.define(:certificate, '0.0.1') do
41
45
  primarily useful for requesting certificates for individual users and
42
46
  external applications.
43
47
  EOT
44
- examples <<-'EOT'
48
+ examples <<-EOT
45
49
  Request a certificate for "somenode" from the site's CA:
46
50
 
47
51
  $ puppet certificate generate somenode.puppetlabs.lan --ca-location remote
@@ -56,7 +60,7 @@ Puppet::Indirector::Face.define(:certificate, '0.0.1') do
56
60
 
57
61
  action :list do
58
62
  summary "List all certificate signing requests."
59
- returns <<-'EOT'
63
+ returns <<-EOT
60
64
  An array of #inspect output from CSR objects. This output is
61
65
  currently messy, but does contain the names of nodes requesting
62
66
  certificates. This action returns #inspect strings even when used
@@ -73,10 +77,10 @@ Puppet::Indirector::Face.define(:certificate, '0.0.1') do
73
77
  action :sign do
74
78
  summary "Sign a certificate signing request for HOST."
75
79
  arguments "<host>"
76
- returns <<-'EOT'
80
+ returns <<-EOT
77
81
  A string that appears to be (but isn't) an x509 certificate.
78
82
  EOT
79
- examples <<-'EOT'
83
+ examples <<-EOT
80
84
  Sign somenode.puppetlabs.lan's certificate:
81
85
 
82
86
  $ puppet certificate sign somenode.puppetlabs.lan --ca-location remote
@@ -93,9 +97,9 @@ Puppet::Indirector::Face.define(:certificate, '0.0.1') do
93
97
  find = get_action(:find)
94
98
  find.summary "Retrieve a certificate."
95
99
  find.arguments "<host>"
96
- find.returns <<-'EOT'
97
- An x509 SSL certificate. You will usually want to render this as a
98
- string (--render-as s).
100
+ find.render_as = :s
101
+ find.returns <<-EOT
102
+ An x509 SSL certificate.
99
103
 
100
104
  Note that this action has a side effect of caching a copy of the
101
105
  certificate in Puppet's `ssldir`.
@@ -105,7 +109,7 @@ Puppet::Indirector::Face.define(:certificate, '0.0.1') do
105
109
  destroy.summary "Delete a certificate."
106
110
  destroy.arguments "<host>"
107
111
  destroy.returns "Nothing."
108
- destroy.description <<-'EOT'
112
+ destroy.description <<-EOT
109
113
  Deletes a certificate. This action currently only works on the local CA.
110
114
  EOT
111
115
 
@@ -5,7 +5,7 @@ Puppet::Indirector::Face.define(:certificate_request, '0.0.1') do
5
5
  license "Apache 2 license; see COPYING"
6
6
 
7
7
  summary "Manage certificate requests."
8
- description <<-'EOT'
8
+ description <<-EOT
9
9
  This subcommand retrieves and submits certificate signing requests (CSRs).
10
10
  EOT
11
11
 
@@ -15,14 +15,12 @@ Puppet::Indirector::Face.define(:certificate_request, '0.0.1') do
15
15
  find = get_action(:find)
16
16
  find.summary "Retrieve a single CSR."
17
17
  find.arguments "<host>"
18
- find.returns <<-'EOT'
18
+ find.render_as = :s
19
+ find.returns <<-EOT
19
20
  A single certificate request. When used from the Ruby API, returns a
20
21
  Puppet::SSL::CertificateRequest object.
21
-
22
- RENDERING ISSUES: In most cases, you will want to render this as a string
23
- ('--render-as s').
24
22
  EOT
25
- find.examples <<-'EOT'
23
+ find.examples <<-EOT
26
24
  Retrieve a single CSR from the puppet master's CA:
27
25
 
28
26
  $ puppet certificate_request find somenode.puppetlabs.lan --terminus rest
@@ -31,10 +29,10 @@ Puppet::Indirector::Face.define(:certificate_request, '0.0.1') do
31
29
  search = get_action(:search)
32
30
  search.summary "Retrieve all outstanding CSRs."
33
31
  search.arguments "<dummy_text>"
34
- search.returns <<-'EOT'
35
- A list of certificate requests; be sure to to render this as a string
36
- ('--render-as s'). When used from the Ruby API, returns an array of
37
- Puppet::SSL::CertificateRequest objects.
32
+ search.render_as = :s
33
+ search.returns <<-EOT
34
+ A list of certificate requests. When used from the Ruby API, returns an
35
+ array of Puppet::SSL::CertificateRequest objects.
38
36
  EOT
39
37
  search.short_description <<-EOT
40
38
  Retrieves all outstanding certificate signing requests. Due to a known bug,
@@ -44,7 +42,7 @@ Puppet::Indirector::Face.define(:certificate_request, '0.0.1') do
44
42
  Although this action always returns all CSRs, it requires a dummy search
45
43
  key; this is a known bug.
46
44
  EOT
47
- search.examples <<-'EOT'
45
+ search.examples <<-EOT
48
46
  Retrieve all CSRs from the local CA (similar to 'puppet cert list'):
49
47
 
50
48
  $ puppet certificate_request search x --terminus ca
@@ -5,7 +5,7 @@ Puppet::Indirector::Face.define(:certificate_revocation_list, '0.0.1') do
5
5
  license "Apache 2 license; see COPYING"
6
6
 
7
7
  summary "Manage the list of revoked certificates."
8
- description <<-'EOT'
8
+ description <<-EOT
9
9
  This subcommand is primarily for retrieving the certificate revocation
10
10
  list from the CA.
11
11
  EOT
@@ -13,12 +13,10 @@ Puppet::Indirector::Face.define(:certificate_revocation_list, '0.0.1') do
13
13
  find = get_action(:find)
14
14
  find.summary "Retrieve the certificate revocation list."
15
15
  find.arguments "<dummy_text>"
16
- find.returns <<-'EOT'
16
+ find.render_as = :s
17
+ find.returns <<-EOT
17
18
  The certificate revocation list. When used from the Ruby API: returns an
18
19
  OpenSSL::X509::CRL object.
19
-
20
- RENDERING ISSUES: this should usually be rendered as a string
21
- ('--render-as s').
22
20
  EOT
23
21
  find.short_description <<-EOT
24
22
  Retrieves the certificate revocation list. Due to a known bug, this action
@@ -28,7 +26,7 @@ Puppet::Indirector::Face.define(:certificate_revocation_list, '0.0.1') do
28
26
  Although this action always returns the CRL from the specified terminus, it
29
27
  requires a dummy argument; this is a known bug.
30
28
  EOT
31
- find.examples <<-'EXAMPLES'
29
+ find.examples <<-EXAMPLES
32
30
  Retrieve a copy of the puppet master's CRL:
33
31
 
34
32
  $ puppet certificate_revocation_list find crl --terminus rest
@@ -38,7 +36,7 @@ Puppet::Indirector::Face.define(:certificate_revocation_list, '0.0.1') do
38
36
  destroy.summary "Delete the certificate revocation list."
39
37
  destroy.arguments "<dummy_text>"
40
38
  destroy.returns "Nothing."
41
- destroy.description <<-'EOT'
39
+ destroy.description <<-EOT
42
40
  Deletes the certificate revocation list. This cannot be done over REST, but
43
41
  it is possible to delete the locally cached copy or the local CA's copy of
44
42
  the CRL.