summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2021-02-07 11:52:51 -0800
committerGitHub <noreply@github.com>2021-02-07 11:52:51 -0800
commit00c097c01d94595654d3c1c153326f99580119a2 (patch)
tree9711a7541691454fae9a9d26f79a4c4d3d110ef9 /lib
parenta221b9423b20084072ad91db4912a2be729e6d11 (diff)
parent15489c9ad32f5f83b0be49bb11fd74927c29f2eb (diff)
downloadchef-00c097c01d94595654d3c1c153326f99580119a2.tar.gz
Merge pull request #10992 from chef/more_docs
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'lib')
-rw-r--r--lib/chef/resource/windows_env.rb9
-rw-r--r--lib/chef/resource/windows_security_policy.rb2
-rw-r--r--lib/chef/resource/windows_share.rb8
3 files changed, 8 insertions, 11 deletions
diff --git a/lib/chef/resource/windows_env.rb b/lib/chef/resource/windows_env.rb
index ab65465ed6..7620e90bad 100644
--- a/lib/chef/resource/windows_env.rb
+++ b/lib/chef/resource/windows_env.rb
@@ -19,6 +19,7 @@
require_relative "../resource"
require_relative "../mixin/windows_env_helper"
+require "chef-utils/dist" unless defined?(ChefUtils::Dist)
class Chef
class Resource
@@ -28,7 +29,7 @@ class Chef
provides :windows_env
provides :env # backwards compat with the pre-Chef 14 resource name
- description "Use the **windows_env** resource to manage environment keys in Microsoft Windows. After an environment key is set, Microsoft Windows must be restarted before the environment key will be available to the Task Scheduler."
+ description "Use the **windows_env** resource to manage environment keys in Microsoft Windows. After an environment key is set, Microsoft Windows must be restarted before the environment key will be available to the Task Scheduler.\nThis resource was previously called the **env** resource; its name was updated in #{ChefUtils::Dist::Infra::PRODUCT} 14.0 to reflect the fact that only Windows is supported. Existing cookbooks using `env` will continue to function, but should be updated to use the new name. Note: On UNIX-based systems, the best way to manipulate environment keys is with the `ENV` variable in Ruby; however, this approach does not have the same permanent effect as using the windows_env resource."
examples <<~DOC
**Set an environment variable**:
@@ -192,7 +193,7 @@ class Chef
end
end
- action :create do
+ action :create, description: "Create an environment variable. If an environment variable already exists (but does not match), update that environment variable to match." do
if key_exists?
if requires_modify_or_create?
modify_env
@@ -206,7 +207,7 @@ class Chef
end
end
- action :delete do
+ action :delete, description: "Delete an environment variable." do
if ( ENV[new_resource.key_name] || key_exists? ) && !delete_element
delete_env
logger.info("#{new_resource} deleted")
@@ -214,7 +215,7 @@ class Chef
end
end
- action :modify do
+ action :modify, description: "Modify an existing environment variable. This prepends the new value to the existing value, using the delimiter specified by the `delim` property." do
if key_exists?
if requires_modify_or_create?
modify_env
diff --git a/lib/chef/resource/windows_security_policy.rb b/lib/chef/resource/windows_security_policy.rb
index 78d56e2e46..980b59a0ca 100644
--- a/lib/chef/resource/windows_security_policy.rb
+++ b/lib/chef/resource/windows_security_policy.rb
@@ -98,7 +98,7 @@ class Chef
secvalue current_state[desired.secoption.to_s]
end
- action :set do
+ action :set, description: "Set the Windows security policy" do
converge_if_changed :secvalue do
security_option = new_resource.secoption
security_value = new_resource.secvalue
diff --git a/lib/chef/resource/windows_share.rb b/lib/chef/resource/windows_share.rb
index fe1e976747..fca63ade05 100644
--- a/lib/chef/resource/windows_share.rb
+++ b/lib/chef/resource/windows_share.rb
@@ -192,9 +192,7 @@ class Chef
name
end
- action :create do
- description "Create and modify Windows shares."
-
+ action :create, description: "Create or modify a Windows share" do
# we do this here instead of requiring the property because :delete doesn't need path set
raise "No path property set" unless new_resource.path
@@ -218,9 +216,7 @@ class Chef
end
end
- action :delete do
- description "Delete an existing Windows share."
-
+ action :delete, description: "Delete an existing Windows share" do
if current_resource.nil?
Chef::Log.debug("#{new_resource.share_name} does not exist - nothing to do")
else