summaryrefslogtreecommitdiff
path: root/lib/chef/resource/windows_certificate.rb
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-06-05 10:41:50 -0700
committerTim Smith <tsmith84@gmail.com>2020-06-05 10:41:50 -0700
commita9f64349802c724e2c4e639a6bc4730dd31a09c7 (patch)
treeec660798d4cc2744740c2c2d0682b56b5785cee3 /lib/chef/resource/windows_certificate.rb
parenta83a20d9f8cde101101a237580cb96d67782d17b (diff)
downloadchef-a9f64349802c724e2c4e639a6bc4730dd31a09c7.tar.gz
Add more resource docs + improve yaml generationresource_docs
Skip defaults that are empty strings. There's a few of these floating around. Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'lib/chef/resource/windows_certificate.rb')
-rw-r--r--lib/chef/resource/windows_certificate.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/chef/resource/windows_certificate.rb b/lib/chef/resource/windows_certificate.rb
index c6e32d9fa5..967ef2f811 100644
--- a/lib/chef/resource/windows_certificate.rb
+++ b/lib/chef/resource/windows_certificate.rb
@@ -30,6 +30,32 @@ class Chef
description "Use the **windows_certificate** resource to install a certificate into the Windows certificate store from a file. The resource grants read-only access to the private key for designated accounts. Due to current limitations in WinRM, installing certificates remotely may not work if the operation requires a user profile. Operations on the local machine store should still work."
introduced "14.7"
+ examples <<~DOC
+ **Add PFX cert to local machine personal store and grant accounts read-only access to private key**
+
+ ```ruby
+ windows_certificate 'c:/test/mycert.pfx' do
+ pfx_password 'password'
+ private_key_acl ["acme\fred", "pc\jane"]
+ end
+ ```
+
+ **Add cert to trusted intermediate store**
+
+ ```ruby
+ windows_certificate 'c:/test/mycert.cer' do
+ store_name 'CA'
+ end
+ ```
+
+ **Remove all certificates matching the subject**
+
+ ```ruby
+ windows_certificate 'me.acme.com' do
+ action :delete
+ end
+ ```
+ DOC
property :source, String,
description: "The source file (for create and acl_add), thumbprint (for delete and acl_add) or subject (for delete) if it differs from the resource block's name.",