diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/chef/resource/windows_ad_join.rb | 29 | ||||
-rw-r--r-- | lib/chef/resource/windows_auto_run.rb | 11 | ||||
-rw-r--r-- | lib/chef/resource/windows_certificate.rb | 26 |
3 files changed, 66 insertions, 0 deletions
diff --git a/lib/chef/resource/windows_ad_join.rb b/lib/chef/resource/windows_ad_join.rb index b0b6824f88..b1584d93d8 100644 --- a/lib/chef/resource/windows_ad_join.rb +++ b/lib/chef/resource/windows_ad_join.rb @@ -25,6 +25,35 @@ class Chef description "Use the **windows_ad_join** resource to join a Windows Active Directory domain." introduced "14.0" + examples <<~DOC + **Join a domain** + + ```ruby + windows_ad_join 'ad.example.org' do + domain_user 'nick' + domain_password 'p@ssw0rd1' + end + ``` + + **Join a domain, as `win-workstation`** + + ```ruby + windows_ad_join 'ad.example.org' do + domain_user 'nick' + domain_password 'p@ssw0rd1' + new_hostname 'win-workstation' + end + ``` + + **Leave the current domain and re-join the `local` workgroup** + + ```ruby + windows_ad_join 'Leave domain' do + action :leave + workgroup 'local' + end + ``` + DOC property :domain_name, String, description: "An optional property to set the FQDN of the Active Directory domain to join if it differs from the resource block's name.", diff --git a/lib/chef/resource/windows_auto_run.rb b/lib/chef/resource/windows_auto_run.rb index 1b3de8a68c..11f383b9d3 100644 --- a/lib/chef/resource/windows_auto_run.rb +++ b/lib/chef/resource/windows_auto_run.rb @@ -25,6 +25,17 @@ class Chef description "Use the **windows_auto_run** resource to set applications to run at login." introduced "14.0" + examples <<~DOC + **Run BGInfo at login**: + + ```ruby + windows_auto_run 'BGINFO' do + program 'C:/Sysinternals/bginfo.exe' + args '\'C:/Sysinternals/Config.bgi\' /NOLICPROMPT /TIMER:0' + action :create + end + ``` + DOC property :program_name, String, description: "The name of the program to run at login if it differs from the resource block's name.", 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.", |