summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Edwards <adamed@opscode.com>2015-09-04 16:51:33 -0700
committeradamedx <adamed@getchef.com>2015-09-23 23:50:10 -0700
commit811cb3de1336d6d28389bc6d6252f37e70e45f82 (patch)
tree323787551f9fd5daeff069dcd5a5b2e9ca518f28
parentefe6286540a56960e109dcc65db63cc7461c1753 (diff)
downloadchef-adamedx/ps_credential_docs.tar.gz
Document LCM certificate configuration example for ps_credential support for DSCadamedx/ps_credential_docs
-rw-r--r--DOC_CHANGES.md27
1 files changed, 26 insertions, 1 deletions
diff --git a/DOC_CHANGES.md b/DOC_CHANGES.md
index 0b467f2570..dd025322cc 100644
--- a/DOC_CHANGES.md
+++ b/DOC_CHANGES.md
@@ -98,7 +98,32 @@ dsc_script 'create-foo-user' do
end
```
-Note, you still need to configure the CertificateID in the LCM.
+Note, you **MUST** still do a one-time configuration of the `CertificateID` used in the recipe above with the DSC Local Configuration Manager (LCM) before this recipe fragment will succeed. The following Chef code could be used to configure the LCM to use the certificate `A8DB81D8059F349F7EF19104399B898F701D4167` stored in the Windows certificate store location `cert:localmachine\my`:
+
+```ruby
+lcm_cert_thumbprint = 'A8DB81D8059F349F7EF19104399B898F701D4167'
+
+powershell_script 'lcm_cert_script' do
+ code <<-EOH
+Configuration 'lcm_cert_configuration' {
+ node 'localhost' {
+ localconfigurationmanager {
+ CertificateID = "#{lcm_cert_thumbprint}"
+ ConfigurationMode = 'ApplyOnly'
+ RebootNodeIfNeeded = $false
+ RefreshMode = 'PUSH'
+ }
+ }
+}
+
+lcm_cert_configuration
+
+set-dsclocalconfigurationmanager -path .\\lcm_cert_configuration
+EOH
+
+ not_if "(Get-DscLocalConfigurationManager).certificateid -eq '#{lcm_cert_thumbprint}'"
+end
+```
### chef-client -j JSON
Add to the [description of chef-client options](https://docs.chef.io/ctl_chef_client.html#options):