summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2020-10-15 16:22:58 -0700
committerGitHub <noreply@github.com>2020-10-15 16:22:58 -0700
commitb9040046103bda65293a1d0adca82fca6a820cd9 (patch)
treea69c1d9b71cb0b8f643e64013afb127ec4e33bd6
parent93149b19111310e4a85afa51f77a7cc8bdb73a13 (diff)
parent92125c9aba6cf734b4c60db98abc137fccdf285d (diff)
downloadchef-b9040046103bda65293a1d0adca82fca6a820cd9.tar.gz
Merge pull request #10509 from chef/more_resource_docs
More resource documentation improvement
-rw-r--r--lib/chef/resource/file.rb2
-rw-r--r--lib/chef/resource/powershell_script.rb12
-rw-r--r--lib/chef/resource/registry_key.rb1
3 files changed, 7 insertions, 8 deletions
diff --git a/lib/chef/resource/file.rb b/lib/chef/resource/file.rb
index 7bebc4ae4c..214f8018ab 100644
--- a/lib/chef/resource/file.rb
+++ b/lib/chef/resource/file.rb
@@ -56,7 +56,7 @@ class Chef
allowed_actions :create, :delete, :touch, :create_if_missing
property :path, String, name_property: true,
- description: "The full path to the file, including the file name and its extension. For example: /files/file.txt. Default value: the name of the resource block. Microsoft Windows: A path that begins with a forward slash (/) will point to the root of the current working directory of the #{ChefUtils::Dist::Infra::CLIENT} process. This path can vary from system to system. Therefore, using a path that begins with a forward slash (/) is not recommended."
+ description: "The full path to the file, including the file name and its extension. For example: /files/file.txt. Default value: the name of the resource block. Microsoft Windows: A path that begins with a forward slash `/` will point to the root of the current working directory of the #{ChefUtils::Dist::Infra::PRODUCT} process. This path can vary from system to system. Therefore, using a path that begins with a forward slash `/` is not recommended."
property :atomic_update, [ TrueClass, FalseClass ], desired_state: false, default: lazy { docker? && special_docker_files?(path) ? false : Chef::Config[:file_atomic_update] },
default_description: "False if modifying /etc/hosts, /etc/hostname, or /etc/resolv.conf within Docker containers. Otherwise default to the client.rb 'file_atomic_update' config value.",
diff --git a/lib/chef/resource/powershell_script.rb b/lib/chef/resource/powershell_script.rb
index 768d5f6ca7..784df68db1 100644
--- a/lib/chef/resource/powershell_script.rb
+++ b/lib/chef/resource/powershell_script.rb
@@ -26,6 +26,12 @@ class Chef
provides :powershell_script, os: "windows"
+ description <<~DESC
+ Use the **powershell_script** resource to execute a script using the Windows PowerShell interpreter, much like how the script and script-based resources **bash**, **csh**, **perl**, **python**, and **ruby** are used. The **powershell_script** resource is specific to the Microsoft Windows platform, but may use both the the Windows PowerShell interpreter or the PowerShell Core (pwsh) interpreter as of Chef Infra Client 16.6 and later.
+
+ The **powershell_script** resource creates and executes a temporary file rather than running the command inline. Commands that are executed with this resource are (by their nature) not idempotent, as they are typically unique to the environment in which they are run. Use `not_if` and `only_if` conditionals to guard this resource for idempotence.
+ DESC
+
property :flags, String,
description: "A string that is passed to the Windows PowerShell command"
@@ -58,12 +64,6 @@ class Chef
```
DESC
- description <<~DESC
- Use the **powershell_script** resource to execute a script using the Windows PowerShell interpreter, much like how the script and script-based resources **bash**, **csh**, **perl**, **python**, and **ruby** are used. The **powershell_script** resource is specific to the Microsoft Windows platform, but may use both the the Windows PowerShell interpreter or the PowerShell Core (pwsh) interpreter as of Chef Infra Client 16.6 and later.
-
- The **powershell_script** resource creates and executes a temporary file rather than running the command inline. Commands that are executed with this resource are (by their nature) not idempotent, as they are typically unique to the environment in which they are run. Use `not_if` and `only_if` conditionals to guard this resource for idempotence.
- DESC
-
def initialize(*args)
super
@default_guard_interpreter = resource_name
diff --git a/lib/chef/resource/registry_key.rb b/lib/chef/resource/registry_key.rb
index 5cce4bd420..ae8fcc3688 100644
--- a/lib/chef/resource/registry_key.rb
+++ b/lib/chef/resource/registry_key.rb
@@ -27,7 +27,6 @@ class Chef
provides(:registry_key) { true }
description "Use the **registry_key** resource to create and delete registry keys in Microsoft Windows."
- introduced "11.0"
state_attrs :values