summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-10-15 15:51:41 -0700
committerTim Smith <tsmith84@gmail.com>2020-10-15 16:08:38 -0700
commit92125c9aba6cf734b4c60db98abc137fccdf285d (patch)
tree0a60436e49378b34728d614665fcf2442e76e0e7
parent27bd4d9dc82be94873418af1e153d73d5cced97f (diff)
downloadchef-92125c9aba6cf734b4c60db98abc137fccdf285d.tar.gz
More resource documentation improvement
Prevent tagging a resource new in Chef 11. No one cares Use the full product name instead of the client name in another spot Move the resource description in powershell_script to above the properties Signed-off-by: Tim Smith <tsmith@chef.io>
-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