summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-02-13 16:34:47 +0000
committerTim Smith <tsmith@chef.io>2018-02-14 11:37:36 -0800
commit5c2b9e201f65d04252a86b1ad89d756f3e73792f (patch)
tree7eaa3b8131eef7afa79422a79b0219021a5972b6 /lib
parentc563a379b2ac9a47f5bd5c9e0c40bebed86aae8c (diff)
downloadchef-5c2b9e201f65d04252a86b1ad89d756f3e73792f.tar.gz
Add new introduced and description resource properties to many resource
Not all of them, but a good chunk. Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'lib')
-rw-r--r--lib/chef/resource/apt_package.rb3
-rw-r--r--lib/chef/resource/apt_preference.rb8
-rw-r--r--lib/chef/resource/apt_repository.rb8
-rw-r--r--lib/chef/resource/apt_update.rb7
-rw-r--r--lib/chef/resource/bash.rb10
-rw-r--r--lib/chef/resource/batch.rb14
-rw-r--r--lib/chef/resource/bff_package.rb9
-rw-r--r--lib/chef/resource/breakpoint.rb15
-rw-r--r--lib/chef/resource/cab_package.rb7
-rw-r--r--lib/chef/resource/chocolatey_package.rb8
-rw-r--r--lib/chef/resource/cookbook_file.rb21
-rw-r--r--lib/chef/resource/cron.rb5
-rw-r--r--lib/chef/resource/csh.rb10
-rw-r--r--lib/chef/resource/directory.rb11
-rw-r--r--lib/chef/resource/dnf_package.rb13
-rw-r--r--lib/chef/resource/dpkg_package.rb6
-rw-r--r--lib/chef/resource/dsc_resource.rb11
-rw-r--r--lib/chef/resource/dsc_script.rb14
-rw-r--r--lib/chef/resource/execute.rb8
-rw-r--r--lib/chef/resource/file.rb3
-rw-r--r--lib/chef/resource/freebsd_package.rb3
-rw-r--r--lib/chef/resource/gem_package.rb7
-rw-r--r--lib/chef/resource/git.rb6
-rw-r--r--lib/chef/resource/group.rb5
-rw-r--r--lib/chef/resource/homebrew_package.rb6
-rw-r--r--lib/chef/resource/http_request.rb6
-rw-r--r--lib/chef/resource/ifconfig.rb4
-rw-r--r--lib/chef/resource/ips_package.rb3
-rw-r--r--lib/chef/resource/ksh.rb13
-rw-r--r--lib/chef/resource/launchd.rb6
30 files changed, 147 insertions, 103 deletions
diff --git a/lib/chef/resource/apt_package.rb b/lib/chef/resource/apt_package.rb
index 51e38834b6..ea0c9c6183 100644
--- a/lib/chef/resource/apt_package.rb
+++ b/lib/chef/resource/apt_package.rb
@@ -21,11 +21,12 @@ require "chef/provider/package/apt"
class Chef
class Resource
- # Use the apt_package resource to manage packages on Debian and Ubuntu platforms.
class AptPackage < Chef::Resource::Package
resource_name :apt_package
provides :package, os: "linux", platform_family: "debian"
+ description "Use the apt_package resource to manage packages on Debian and Ubuntu platforms."
+
property :default_release, String, desired_state: false
property :overwrite_config_files, [TrueClass, FalseClass], default: false
diff --git a/lib/chef/resource/apt_preference.rb b/lib/chef/resource/apt_preference.rb
index 87c5a5a016..442d85a78a 100644
--- a/lib/chef/resource/apt_preference.rb
+++ b/lib/chef/resource/apt_preference.rb
@@ -20,14 +20,16 @@ require "chef/resource"
class Chef
class Resource
- # The apt_preference resource allows for the creation of APT preference files. Preference files are used to control
- # which package versions and sources are prioritized during installation.
- #
# @since 13.3
class AptPreference < Chef::Resource
resource_name :apt_preference
provides :apt_preference
+ description "The apt_preference resource allows for the creation of APT preference"\
+ " files. Preference files are used to control which package versions and"\
+ " sources are prioritized during installation."
+ introduced "13.3"
+
property :package_name, String, name_property: true, regex: [/^([a-z]|[A-Z]|[0-9]|_|-|\.|\*|\+)+$/]
property :glob, String
property :pin, String, required: true
diff --git a/lib/chef/resource/apt_repository.rb b/lib/chef/resource/apt_repository.rb
index 5b81112cbe..6b044afe27 100644
--- a/lib/chef/resource/apt_repository.rb
+++ b/lib/chef/resource/apt_repository.rb
@@ -20,14 +20,14 @@ require "chef/resource"
class Chef
class Resource
- # Use the apt_repository resource to specify additional APT repositories. Adding a new repository will update
- # APT package cache immediately.
- #
- # @since 12.9
class AptRepository < Chef::Resource
resource_name :apt_repository
provides :apt_repository
+ description "Use the apt_repository resource to specify additional APT repositories."\
+ " Adding a new repository will update APT package cache immediately."
+ introduced "12.9"
+
property :repo_name, String, name_property: true
property :uri, String
property :distribution, [ String, nil, false ], default: lazy { node["lsb"]["codename"] }, coerce: proc { |x| x ? x : nil }
diff --git a/lib/chef/resource/apt_update.rb b/lib/chef/resource/apt_update.rb
index 0349614ad2..378edd2170 100644
--- a/lib/chef/resource/apt_update.rb
+++ b/lib/chef/resource/apt_update.rb
@@ -20,13 +20,14 @@ require "chef/resource"
class Chef
class Resource
- # Use the apt_update resource to manage APT repository updates on Debian and Ubuntu platforms.
- #
- # @since 12.7
class AptUpdate < Chef::Resource
resource_name :apt_update
provides :apt_update
+ description "Use the apt_update resource to manage APT repository updates on"\
+ " Debian and Ubuntu platforms."
+ introduced "12.7"
+
# allow bare apt_update with no name
property :name, String, default: ""
property :frequency, Integer, default: 86_400
diff --git a/lib/chef/resource/bash.rb b/lib/chef/resource/bash.rb
index ebc4a7790b..03fdd0e396 100644
--- a/lib/chef/resource/bash.rb
+++ b/lib/chef/resource/bash.rb
@@ -21,11 +21,13 @@ require "chef/provider/script"
class Chef
class Resource
- # Use the bash resource to execute scripts using the Bash 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 Bash < Chef::Resource::Script
+ description "Use the bash resource to execute scripts using the Bash 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
diff --git a/lib/chef/resource/batch.rb b/lib/chef/resource/batch.rb
index b3c7b17cef..1c666a46ba 100644
--- a/lib/chef/resource/batch.rb
+++ b/lib/chef/resource/batch.rb
@@ -20,15 +20,17 @@ require "chef/resource/windows_script"
class Chef
class Resource
- # Use the batch resource to execute a batch script using the cmd.exe interpreter on Windows. The batch resource
- # creates and executes a temporary file (similar to how the script resource behaves), 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 to guard this resource for
- # idempotence.
class Batch < Chef::Resource::WindowsScript
-
provides :batch, os: "windows"
+ description "Use the batch resource to execute a batch script using the cmd.exe"\
+ " interpreter on Windows. The batch resource creates and executes a"\
+ " temporary file (similar to how the script resource behaves), 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"\
+ " to guard this resource for idempotence."
+
def initialize(name, run_context = nil)
super(name, run_context, nil, "cmd.exe")
end
diff --git a/lib/chef/resource/bff_package.rb b/lib/chef/resource/bff_package.rb
index d91777cb74..f67d6d253e 100644
--- a/lib/chef/resource/bff_package.rb
+++ b/lib/chef/resource/bff_package.rb
@@ -21,11 +21,12 @@ require "chef/provider/package/aix"
class Chef
class Resource
- # Use the bff_package resource to manage packages for the AIX platform using the installp utility. When a package is
- # installed from a local file, it must be added to the node using the remote_file or cookbook_file resources.
- #
- # @since 12.0
class BffPackage < Chef::Resource::Package
+ description "Use the bff_package resource to manage packages for the AIX platform"\
+ " using the installp utility. When a package is installed from a local"\
+ " file, it must be added to the node using the remote_file or cookbook_file"\
+ " resources."
+ introduced "12.0"
end
end
end
diff --git a/lib/chef/resource/breakpoint.rb b/lib/chef/resource/breakpoint.rb
index 5d2c5555be..1ccc4311b3 100644
--- a/lib/chef/resource/breakpoint.rb
+++ b/lib/chef/resource/breakpoint.rb
@@ -20,16 +20,19 @@ require "chef/resource"
class Chef
class Resource
- # Use the breakpoint resource to add breakpoints to recipes. Run the chef-shell in chef-client mode, and then use
- # those breakpoints to debug recipes. Breakpoints are ignored by the chef-client during an actual chef-client run.
- # That said, breakpoints are typically used to debug recipes only when running them in a non-production environment,
- # after which they are removed from those recipes before the parent cookbook is uploaded to the Chef server.
- #
- # @since 12.0
class Breakpoint < Chef::Resource
provides :breakpoint
resource_name :breakpoint
+ description "Use the breakpoint resource to add breakpoints to recipes. Run the"\
+ " chef-shell in chef-client mode, and then use those breakpoints to debug"\
+ " recipes. Breakpoints are ignored by the chef-client during an actual"\
+ " chef-client run. That said, breakpoints are typically used to debug"\
+ " recipes only when running them in a non-production environment, after"\
+ " which they are removed from those recipes before the parent cookbook is"\
+ " uploaded to the Chef server."
+ introduced "12.0"
+
default_action :break
def initialize(action = "break", *args)
diff --git a/lib/chef/resource/cab_package.rb b/lib/chef/resource/cab_package.rb
index 8f3b3038c4..06c84fa559 100644
--- a/lib/chef/resource/cab_package.rb
+++ b/lib/chef/resource/cab_package.rb
@@ -21,15 +21,16 @@ require "chef/mixin/uris"
class Chef
class Resource
- # Use the cab_package resource to install or remove Microsoft Windows cabinet (.cab) packages.
- #
- # @since 12.15
class CabPackage < Chef::Resource::Package
include Chef::Mixin::Uris
resource_name :cab_package
provides :cab_package, os: "windows"
+ description "Use the cab_package resource to install or remove Microsoft Windows"\
+ " cabinet (.cab) packages."
+ introduced "12.15"
+
allowed_actions :install, :remove
property :source, String,
diff --git a/lib/chef/resource/chocolatey_package.rb b/lib/chef/resource/chocolatey_package.rb
index 58bcab8b39..c5a5d827a2 100644
--- a/lib/chef/resource/chocolatey_package.rb
+++ b/lib/chef/resource/chocolatey_package.rb
@@ -20,14 +20,14 @@ require "chef/resource/package"
class Chef
class Resource
- # Use the chocolatey_package resource to manage packages using Chocolatey on the Microsoft Windows platform.
- #
- # @since 12.7
class ChocolateyPackage < Chef::Resource::Package
-
resource_name :chocolatey_package
provides :chocolatey_package, os: "windows"
+ description "Use the chocolatey_package resource to manage packages using Chocolatey"\
+ " on the Microsoft Windows platform."
+ introduced "12.7"
+
allowed_actions :install, :upgrade, :remove, :uninstall, :purge, :reconfig
# windows can't take Array options yet
diff --git a/lib/chef/resource/cookbook_file.rb b/lib/chef/resource/cookbook_file.rb
index 8c3de119e9..593cb5e137 100644
--- a/lib/chef/resource/cookbook_file.rb
+++ b/lib/chef/resource/cookbook_file.rb
@@ -24,20 +24,23 @@ require "chef/mixin/securable"
class Chef
class Resource
- # Use the cookbook_file resource to transfer files from a sub-directory of COOKBOOK_NAME/files/ to a specified path
- # located on a host that is running the chef-client. The file is selected according to file specificity, which allows
- # different source files to be used based on the hostname, host platform (operating system, distro, or as appropriate),
- # or platform version. Files that are located in the COOKBOOK_NAME/files/default sub-directory may be used on any
- # platform.
- #
- # During a chef-client run, the checksum for each local file is calculated and then compared against the checksum for
- # the same file as it currently exists in the cookbook on the Chef server. A file is not transferred when the checksums
- # match. Only files that require an update are transferred from the Chef server to a node.
class CookbookFile < Chef::Resource::File
include Chef::Mixin::Securable
resource_name :cookbook_file
+ description "Use the cookbook_file resource to transfer files from a sub-directory"\
+ " of COOKBOOK_NAME/files/ to a specified path located on a host that is"\
+ " running the chef-client. The file is selected according to file specificity,"\
+ " which allows different source files to be used based on the hostname, host"\
+ " platform (operating system, distro, or as appropriate), or platform version."\
+ " Files that are located in the COOKBOOK_NAME/files/default sub-directory may be"\
+ " used on any platform.\n\n"\
+ "During a chef-client run, the checksum for each local file is calculated and then"\
+ " compared against the checksum for the same file as it currently exists in the"\
+ " cookbook on the Chef server. A file is not transferred when the checksums match."\
+ " Only files that require an update are transferred from the Chef server to a node."
+
property :source, [ String, Array ], default: lazy { ::File.basename(name) }
property :cookbook, String
diff --git a/lib/chef/resource/cron.rb b/lib/chef/resource/cron.rb
index 2b70be7bb8..72023c31ed 100644
--- a/lib/chef/resource/cron.rb
+++ b/lib/chef/resource/cron.rb
@@ -21,9 +21,10 @@ require "chef/resource"
class Chef
class Resource
- # Use the cron resource to manage cron entries for time-based job scheduling. Properties for a schedule will default
- # to * if not provided. The cron resource requires access to a crontab program, typically cron.
class Cron < Chef::Resource
+ description "Use the cron resource to manage cron entries for time-based job scheduling."\
+ " Properties for a schedule will default to * if not provided. The cron resource"\
+ " requires access to a crontab program, typically cron."
identity_attr :command
diff --git a/lib/chef/resource/csh.rb b/lib/chef/resource/csh.rb
index ef302af6c0..0938a19cb1 100644
--- a/lib/chef/resource/csh.rb
+++ b/lib/chef/resource/csh.rb
@@ -21,11 +21,13 @@ require "chef/provider/script"
class Chef
class Resource
- # Use the csh resource to execute scripts using the csh 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 Csh < Chef::Resource::Script
+ description "Use the csh resource to execute scripts using the csh 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
diff --git a/lib/chef/resource/directory.rb b/lib/chef/resource/directory.rb
index b989b3ecde..1f18a4b951 100644
--- a/lib/chef/resource/directory.rb
+++ b/lib/chef/resource/directory.rb
@@ -23,13 +23,16 @@ require "chef/mixin/securable"
class Chef
class Resource
- # Use the directory resource to manage a directory, which is a hierarchy of folders that comprises all of the
- # information stored on a computer. The root directory is the top-level, under which the rest of the directory
- # is organized. The directory resource uses the name property to specify the path to a location in a directory.
- # Typically, permission to access that location in the directory is required.
class Directory < Chef::Resource
resource_name :directory
+ description "Use the directory resource to manage a directory, which is a hierarchy"\
+ " of folders that comprises all of the information stored on a computer."\
+ " The root directory is the top-level, under which the rest of the directory"\
+ " is organized. The directory resource uses the name property to specify the"\
+ " path to a location in a directory. Typically, permission to access that"\
+ " location in the directory is required."
+
state_attrs :group, :mode, :owner
include Chef::Mixin::Securable
diff --git a/lib/chef/resource/dnf_package.rb b/lib/chef/resource/dnf_package.rb
index 0e09d90d43..08d19ff6b9 100644
--- a/lib/chef/resource/dnf_package.rb
+++ b/lib/chef/resource/dnf_package.rb
@@ -21,17 +21,20 @@ require "chef/mixin/shell_out"
class Chef
class Resource
- # Use the dnf_package resource to install, upgrade, and remove packages with DNF for Fedora platforms. The dnf_package
- # resource is able to resolve provides data for packages much like DNF can do when it is run from the command line.
- # This allows a variety of options for installing packages, like minimum versions, virtual provides, and library names.
- #
- # @since 12.18
class DnfPackage < Chef::Resource::Package
extend Chef::Mixin::Which
extend Chef::Mixin::ShellOut
resource_name :dnf_package
+ description "Use the dnf_package resource to install, upgrade, and remove packages"\
+ " with DNF for Fedora platforms. The dnf_package resource is able to"\
+ " resolve provides data for packages much like DNF can do when it is"\
+ " run from the command line. This allows a variety of options for"\
+ " installing packages, like minimum versions, virtual provides,"\
+ " and library names."
+ introduced "12.18"
+
allowed_actions :install, :upgrade, :remove, :purge, :reconfig, :lock, :unlock, :flush_cache
# all rhel variants >= 8 will use DNF
diff --git a/lib/chef/resource/dpkg_package.rb b/lib/chef/resource/dpkg_package.rb
index c73fc506ad..488af8e1c9 100644
--- a/lib/chef/resource/dpkg_package.rb
+++ b/lib/chef/resource/dpkg_package.rb
@@ -20,12 +20,14 @@ require "chef/resource/package"
class Chef
class Resource
- # Use the dpkg_package resource to manage packages for the dpkg platform. When a package is installed from a local
- # file, it must be added to the node using the remote_file or cookbook_file resources.
class DpkgPackage < Chef::Resource::Package
resource_name :dpkg_package
provides :dpkg_package, os: "linux"
+ description "Use the dpkg_package resource to manage packages for the dpkg platform."\
+ " When a package is installed from a local file, it must be added to the"\
+ " node using the remote_file or cookbook_file resources."
+
property :source, [ String, Array, nil ]
end
end
diff --git a/lib/chef/resource/dsc_resource.rb b/lib/chef/resource/dsc_resource.rb
index 0840b9bca1..95ee32c946 100644
--- a/lib/chef/resource/dsc_resource.rb
+++ b/lib/chef/resource/dsc_resource.rb
@@ -19,14 +19,15 @@ require "chef/dsl/powershell"
class Chef
class Resource
- # The dsc_resource resource allows any DSC resource to be used in a Chef recipe, as well as any custom resources
- # that have been added to your Windows PowerShell environment. Microsoft frequently adds new resources to the DSC
- # resource collection.
- #
- # @since 12.2
class DscResource < Chef::Resource
provides :dsc_resource, os: "windows"
+ description "The dsc_resource resource allows any DSC resource to be used in a"\
+ " Chef recipe, as well as any custom resources that have been added"\
+ " to your Windows PowerShell environment. Microsoft frequently adds"\
+ " new resources to the DSC resource collection."
+ introduced "12.2"
+
# This class will check if the object responds to
# to_text. If it does, it will call that as opposed
# to inspect. This is useful for properties that hold
diff --git a/lib/chef/resource/dsc_script.rb b/lib/chef/resource/dsc_script.rb
index cea52e422b..45372c091a 100644
--- a/lib/chef/resource/dsc_script.rb
+++ b/lib/chef/resource/dsc_script.rb
@@ -21,17 +21,21 @@ require "chef/dsl/powershell"
class Chef
class Resource
- # Many DSC resources are comparable to built-in Chef resources. For example, both DSC and Chef have file, package,
- # and service resources. The dsc_script resource is most useful for those DSC resources that do not have a direct
- # comparison to a resource in Chef, such as the Archive resource, a custom DSC resource, an existing DSC script
- # that performs an important task, and so on. Use the dsc_script resource to embed the code that defines a DSC
- # configuration directly within a Chef recipe.
class DscScript < Chef::Resource
include Chef::DSL::Powershell
resource_name :dsc_script
provides :dsc_script, os: "windows"
+ description "Many DSC resources are comparable to built-in Chef resources. For"\
+ " example, both DSC and Chef have file, package, and service resources."\
+ " The dsc_script resource is most useful for those DSC resources that"\
+ " do not have a direct comparison to a resource in Chef, such as the"\
+ " Archive resource, a custom DSC resource, an existing DSC script"\
+ " that performs an important task, and so on. Use the dsc_script resource"\
+ " to embed the code that defines a DSC configuration directly within a"\
+ " Chef recipe."
+
default_action :run
def initialize(name, run_context = nil)
diff --git a/lib/chef/resource/execute.rb b/lib/chef/resource/execute.rb
index 616195deee..0c1b187ed0 100644
--- a/lib/chef/resource/execute.rb
+++ b/lib/chef/resource/execute.rb
@@ -22,13 +22,15 @@ require "chef/provider/execute"
class Chef
class Resource
- # Use the execute resource to execute a single command. 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 Execute < Chef::Resource
identity_attr :command
+ description "Use the execute resource to execute a single command. 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."
+
# The ResourceGuardInterpreter wraps a resource's guards in another resource. That inner resource
# needs to behave differently during (for example) why_run mode, so we flag it here. For why_run mode
# we still want to execute the guard resource even if we are not executing the wrapping resource.
diff --git a/lib/chef/resource/file.rb b/lib/chef/resource/file.rb
index 787992fc24..98341ff940 100644
--- a/lib/chef/resource/file.rb
+++ b/lib/chef/resource/file.rb
@@ -25,10 +25,11 @@ require "pathname"
class Chef
class Resource
- # Use the file resource to manage files directly on a node.
class File < Chef::Resource
include Chef::Mixin::Securable
+ description "Use the file resource to manage files directly on a node."
+
if Platform.windows?
# Use Windows rights instead of standard *nix permissions
state_attrs :checksum, :rights, :deny_rights
diff --git a/lib/chef/resource/freebsd_package.rb b/lib/chef/resource/freebsd_package.rb
index caaba29129..d16355d027 100644
--- a/lib/chef/resource/freebsd_package.rb
+++ b/lib/chef/resource/freebsd_package.rb
@@ -26,13 +26,14 @@ require "chef/mixin/shell_out"
class Chef
class Resource
- # Use the freebsd_package resource to manage packages for the FreeBSD platform.
class FreebsdPackage < Chef::Resource::Package
include Chef::Mixin::ShellOut
resource_name :freebsd_package
provides :package, platform: "freebsd"
+ description "Use the freebsd_package resource to manage packages for the FreeBSD platform."
+
# make sure we assign the appropriate underlying providers based on what
# package managers exist on this FreeBSD system or the source of the package
#
diff --git a/lib/chef/resource/gem_package.rb b/lib/chef/resource/gem_package.rb
index 8e3a426035..1f9bae614d 100644
--- a/lib/chef/resource/gem_package.rb
+++ b/lib/chef/resource/gem_package.rb
@@ -20,11 +20,14 @@ require "chef/resource/package"
class Chef
class Resource
- # Use the gem_package resource to manage gem packages that are only included in recipes. When a package is installed
- # from a local file, it must be added to the node using the remote_file or cookbook_file resources.
class GemPackage < Chef::Resource::Package
resource_name :gem_package
+ description "Use the gem_package resource to manage gem packages that are only"\
+ " included in recipes. When a package is installed from a local file,"\
+ " it must be added to the node using the remote_file or cookbook_file"\
+ " resources."
+
# the source can either be a path to a package source like:
# source /var/tmp/mygem-1.2.3.4.gem
# or it can be a url rubygems source like:
diff --git a/lib/chef/resource/git.rb b/lib/chef/resource/git.rb
index ac4f027552..9f1702f715 100644
--- a/lib/chef/resource/git.rb
+++ b/lib/chef/resource/git.rb
@@ -20,10 +20,12 @@ require "chef/resource/scm"
class Chef
class Resource
- # Use the git resource to manage source control resources that exist in a git repository. git version 1.6.5 (or higher)
- # is required to use all of the functionality in the git resource.
class Git < Chef::Resource::Scm
+ description "Use the git resource to manage source control resources that exist"\
+ " in a git repository. git version 1.6.5 (or higher) is required to"\
+ " use all of the functionality in the git resource."
+
def initialize(name, run_context = nil)
super
@additional_remotes = Hash[]
diff --git a/lib/chef/resource/group.rb b/lib/chef/resource/group.rb
index 69a3827a5c..79a234cb54 100644
--- a/lib/chef/resource/group.rb
+++ b/lib/chef/resource/group.rb
@@ -19,13 +19,12 @@
class Chef
class Resource
- # Use the group resource to manage a local group.
class Group < Chef::Resource
-
identity_attr :group_name
-
state_attrs :members
+ description "Use the group resource to manage a local group."
+
allowed_actions :create, :remove, :modify, :manage
default_action :create
diff --git a/lib/chef/resource/homebrew_package.rb b/lib/chef/resource/homebrew_package.rb
index 6174a31079..dee132a1b4 100644
--- a/lib/chef/resource/homebrew_package.rb
+++ b/lib/chef/resource/homebrew_package.rb
@@ -23,13 +23,13 @@ require "chef/resource/package"
class Chef
class Resource
- # Use the homebrew_package resource to manage packages for the macOS platform.
- #
- # @since 12.0
class HomebrewPackage < Chef::Resource::Package
resource_name :homebrew_package
provides :package, os: "darwin"
+ description "Use the homebrew_package resource to manage packages for the macOS platform."
+ introduced "12.0"
+
property :homebrew_user, [ String, Integer ]
end
diff --git a/lib/chef/resource/http_request.rb b/lib/chef/resource/http_request.rb
index 9d8fce9b22..d3b782ea12 100644
--- a/lib/chef/resource/http_request.rb
+++ b/lib/chef/resource/http_request.rb
@@ -22,12 +22,14 @@ require "chef/provider/http_request"
class Chef
class Resource
- # Use the http_request resource to send an HTTP request (GET, PUT, POST, DELETE, HEAD, or OPTIONS) with an arbitrary
- # message. This resource is often useful when custom callbacks are necessary.
class HttpRequest < Chef::Resource
identity_attr :url
+ description "Use the http_request resource to send an HTTP request (GET, PUT,"\
+ " POST, DELETE, HEAD, or OPTIONS) with an arbitrary message. This"\
+ " resource is often useful when custom callbacks are necessary."
+
default_action :get
allowed_actions :get, :patch, :put, :post, :delete, :head, :options
diff --git a/lib/chef/resource/ifconfig.rb b/lib/chef/resource/ifconfig.rb
index e9ef47d95b..4187c949c4 100644
--- a/lib/chef/resource/ifconfig.rb
+++ b/lib/chef/resource/ifconfig.rb
@@ -21,8 +21,6 @@ require "chef/resource"
class Chef
class Resource
- # use the ifconfig resource to manage interfaces on *nix systems
- #
# @example set a static ip on eth1
# ifconfig '33.33.33.80' do
# device 'eth1'
@@ -30,6 +28,8 @@ class Chef
class Ifconfig < Chef::Resource
resource_name :ifconfig
+ description "Use the ifconfig resource to manage interfaces on *nix systems."
+
state_attrs :inet_addr, :mask
default_action :add
diff --git a/lib/chef/resource/ips_package.rb b/lib/chef/resource/ips_package.rb
index 296919dc1c..88a9f182d4 100644
--- a/lib/chef/resource/ips_package.rb
+++ b/lib/chef/resource/ips_package.rb
@@ -21,12 +21,13 @@ require "chef/provider/package/ips"
class Chef
class Resource
- # Use the ips_package resource to manage packages (using Image Packaging System (IPS)) on the Solaris 11 platform.
class IpsPackage < ::Chef::Resource::Package
resource_name :ips_package
provides :package, os: "solaris2"
provides :ips_package, os: "solaris2"
+ description "Use the ips_package resource to manage packages (using Image Packaging System (IPS)) on the Solaris 11 platform."
+
allowed_actions :install, :remove, :upgrade
property :accept_license, [ true, false ], default: false, desired_state: false
diff --git a/lib/chef/resource/ksh.rb b/lib/chef/resource/ksh.rb
index 8024f0d6bd..f0bc277d17 100644
--- a/lib/chef/resource/ksh.rb
+++ b/lib/chef/resource/ksh.rb
@@ -20,13 +20,14 @@ require "chef/resource/script"
class Chef
class Resource
- # Use the ksh resource to execute scripts using the Korn shell (ksh) interpreter. This resource may also use any
- # f 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.
- #
- # @since 12.6
class Ksh < Chef::Resource::Script
+ description "Use the ksh resource to execute scripts using the Korn shell (ksh)"\
+ " 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."
+ introduced "12.6"
def initialize(name, run_context = nil)
super
diff --git a/lib/chef/resource/launchd.rb b/lib/chef/resource/launchd.rb
index 121af1555c..bc1b7d48e8 100644
--- a/lib/chef/resource/launchd.rb
+++ b/lib/chef/resource/launchd.rb
@@ -20,13 +20,13 @@ require "chef/resource"
class Chef
class Resource
- # Use the launchd resource to manage system-wide services (daemons) and per-user services (agents) on the macOS platform.
- #
- # @since 12.8
class Launchd < Chef::Resource
resource_name :launchd
provides :launchd, os: "darwin"
+ description "Use the launchd resource to manage system-wide services (daemons) and per-user services (agents) on the macOS platform."
+ introduced "12.8"
+
default_action :create
allowed_actions :create, :create_if_missing, :delete, :enable, :disable, :restart