summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-03-16 11:39:20 -0700
committerTim Smith <tsmith@chef.io>2018-03-16 13:46:50 -0700
commitc928e064bfa907b3576df2c753a7a3de883ab2ad (patch)
treeae0c637ef8cfd7f8e46194ad2ef8a4fdf08d0db9
parent9b98267b1461a4c04af03caa80fac6216e6cc637 (diff)
downloadchef-c928e064bfa907b3576df2c753a7a3de883ab2ad.tar.gz
Add more resource descriptions
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--lib/chef/resource/powershell_package.rb7
-rw-r--r--lib/chef/resource/python.rb9
-rw-r--r--lib/chef/resource/reboot.rb13
-rw-r--r--lib/chef/resource/remote_directory.rb8
-rw-r--r--lib/chef/resource/remote_file.rb5
-rw-r--r--lib/chef/resource/ruby.rb10
-rw-r--r--lib/chef/resource/ruby_block.rb8
-rw-r--r--lib/chef/resource/scm.rb2
-rw-r--r--lib/chef/resource/script.rb9
9 files changed, 39 insertions, 32 deletions
diff --git a/lib/chef/resource/powershell_package.rb b/lib/chef/resource/powershell_package.rb
index f5ff99fff8..184b63f950 100644
--- a/lib/chef/resource/powershell_package.rb
+++ b/lib/chef/resource/powershell_package.rb
@@ -20,15 +20,16 @@ require "chef/mixin/uris"
class Chef
class Resource
- # Use the powershell_package resource to install and manage packages via the Powershell Package Manager for the
- # Microsoft Windows platform. The powershell_package resource requires administrative access, and a source must be
- # configured in the Powershell Package Manager via the Register-PackageSource command
class PowershellPackage < Chef::Resource::Package
include Chef::Mixin::Uris
resource_name :powershell_package
provides :powershell_package
+ description "Use the powershell_package resource to install and manage packages via"\
+ " the Powershell Package Manager for the Microsoft Windows platform. The"\
+ " powershell_package resource requires administrative access, and a source"\
+ " must be configured in the Powershell Package Manager via the Register-PackageSource command"
introduced "12.16"
allowed_actions :install, :remove
diff --git a/lib/chef/resource/python.rb b/lib/chef/resource/python.rb
index 8c9e74217a..f6c259b858 100644
--- a/lib/chef/resource/python.rb
+++ b/lib/chef/resource/python.rb
@@ -20,16 +20,17 @@ require "chef/provider/script"
class Chef
class Resource
- # Use the python resource to execute scripts using the Python interpreter. This resource may also use any of the actions
- # and properties that are available to the execute resource. 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 to guard this resource for idempotence.
class Python < Chef::Resource::Script
def initialize(name, run_context = nil)
super
@interpreter = "python"
end
+ description "Use the python resource to execute scripts using the Python interpreter."\
+ " This resource may also use any of the actions and properties that are available"\
+ " to the execute resource. 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 to guard this resource for idempotence."
end
end
end
diff --git a/lib/chef/resource/reboot.rb b/lib/chef/resource/reboot.rb
index 9879c05395..bc649bee09 100644
--- a/lib/chef/resource/reboot.rb
+++ b/lib/chef/resource/reboot.rb
@@ -20,16 +20,15 @@ require "chef/resource"
class Chef
class Resource
- # Use the reboot resource to reboot a node, a necessary step with some
- # installations on certain platforms. This resource is supported for use on
- # the Microsoft Windows, macOS, and Linux platforms.
- #
- # In using this resource via notifications, it's important to *only* use
- # immediate notifications. Delayed notifications produce unintuitive and
- # probably undesired results.
class Reboot < Chef::Resource
resource_name :reboot
+ description "Use the reboot resource to reboot a node, a necessary step with some"\
+ " installations on certain platforms. This resource is supported for use on"\
+ " the Microsoft Windows, macOS, and Linux platforms.\n"\
+ "In using this resource via notifications, it's important to *only* use"\
+ " immediate notifications. Delayed notifications produce unintuitive and"\
+ " probably undesired results."
introduced "12.0"
allowed_actions :request_reboot, :reboot_now, :cancel
diff --git a/lib/chef/resource/remote_directory.rb b/lib/chef/resource/remote_directory.rb
index b165606c79..677f358cc2 100644
--- a/lib/chef/resource/remote_directory.rb
+++ b/lib/chef/resource/remote_directory.rb
@@ -23,12 +23,14 @@ require "chef/mixin/securable"
class Chef
class Resource
- # Use the remote_directory resource to incrementally transfer a directory from a cookbook to a node. The director
- # that is copied from the cookbook should be located under COOKBOOK_NAME/files/default/REMOTE_DIRECTORY. The
- # remote_directory resource will obey file specificity.
class RemoteDirectory < Chef::Resource::Directory
include Chef::Mixin::Securable
+ description "Use the remote_directory resource to incrementally transfer a directory"\
+ " from a cookbook to a node. The director that is copied from the cookbook"\
+ " should be located under COOKBOOK_NAME/files/default/REMOTE_DIRECTORY. The"\
+ " remote_directory resource will obey file specificity."
+
identity_attr :path
state_attrs :files_owner, :files_group, :files_mode
diff --git a/lib/chef/resource/remote_file.rb b/lib/chef/resource/remote_file.rb
index a320fd8b47..7aaff890ef 100644
--- a/lib/chef/resource/remote_file.rb
+++ b/lib/chef/resource/remote_file.rb
@@ -25,11 +25,12 @@ require "chef/mixin/uris"
class Chef
class Resource
- # Use the remote_file resource to transfer a file from a remote location using file specificity. This resource is
- # similar to the file resource.
class RemoteFile < Chef::Resource::File
include Chef::Mixin::Securable
+ description "Use the remote_file resource to transfer a file from a remote location"\
+ " using file specificity. This resource is similar to the file resource."
+
def initialize(name, run_context = nil)
super
@source = []
diff --git a/lib/chef/resource/ruby.rb b/lib/chef/resource/ruby.rb
index 300405f89e..b5f36bb0e9 100644
--- a/lib/chef/resource/ruby.rb
+++ b/lib/chef/resource/ruby.rb
@@ -21,11 +21,13 @@ require "chef/provider/script"
class Chef
class Resource
- # Use the ruby resource to execute scripts using the Ruby interpreter. This resource may also use any of the actions
- # and properties that are available to the execute resource. 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 to guard this resource for idempotence.
class Ruby < Chef::Resource::Script
+ description "Use the ruby resource to execute scripts using the Ruby interpreter. This"\
+ " resource may also use any of the actions and properties that are available"\
+ " to the execute resource. 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 to guard this resource for idempotence."
+
def initialize(name, run_context = nil)
super
@interpreter = "ruby"
diff --git a/lib/chef/resource/ruby_block.rb b/lib/chef/resource/ruby_block.rb
index a3cb9e56e5..911e6203d8 100644
--- a/lib/chef/resource/ruby_block.rb
+++ b/lib/chef/resource/ruby_block.rb
@@ -22,10 +22,12 @@ require "chef/provider/ruby_block"
class Chef
class Resource
- # Use the ruby_block resource to execute Ruby code during a chef-client run. Ruby code in the ruby_block resource is
- # evaluated with other resources during convergence, whereas Ruby code outside of a ruby_block resource is evaluated
- # before other resources, as the recipe is compiled.
class RubyBlock < Chef::Resource
+ description "Use the ruby_block resource to execute Ruby code during a chef-client run."\
+ " Ruby code in the ruby_block resource is evaluated with other resources during"\
+ " convergence, whereas Ruby code outside of a ruby_block resource is evaluated"\
+ " before other resources, as the recipe is compiled."
+
default_action :run
allowed_actions :create, :run
diff --git a/lib/chef/resource/scm.rb b/lib/chef/resource/scm.rb
index 179a3adefd..8bc55a7974 100644
--- a/lib/chef/resource/scm.rb
+++ b/lib/chef/resource/scm.rb
@@ -62,8 +62,6 @@ class Chef
:kind_of => String)
end
-
-
alias :env :environment
end
end
diff --git a/lib/chef/resource/script.rb b/lib/chef/resource/script.rb
index 7cadb843e5..d3562ee6f5 100644
--- a/lib/chef/resource/script.rb
+++ b/lib/chef/resource/script.rb
@@ -21,15 +21,16 @@ require "chef/resource/execute"
class Chef
class Resource
- # Use the script resource to execute scripts using a specified interpreter, such as Bash, csh, Perl, Python, or Ruby.
- # This resource may also use any of the actions and properties that are available to the execute resource. 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 to guard this resource for idempotence.
class Script < Chef::Resource::Execute
resource_name :script
identity_attr :name
+ description "Use the script resource to execute scripts using a specified interpreter, such as Bash, csh, Perl, Python, or Ruby."\
+ " This resource may also use any of the actions and properties that are available to the execute resource. 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 to guard this resource for idempotence."
+
def initialize(name, run_context = nil)
super
@command = nil