diff options
-rw-r--r-- | lib/chef/resource/alternatives.rb | 10 | ||||
-rw-r--r-- | lib/chef/resource/apt_preference.rb | 4 | ||||
-rw-r--r-- | lib/chef/resource/apt_repository.rb | 4 | ||||
-rw-r--r-- | lib/chef/resource/apt_update.rb | 5 | ||||
-rw-r--r-- | lib/chef/resource/archive_file.rb | 2 | ||||
-rw-r--r-- | lib/chef/resource/breakpoint.rb | 2 | ||||
-rw-r--r-- | lib/chef/resource/build_essential.rb | 2 | ||||
-rw-r--r-- | lib/chef/resource/chef_client_config.rb | 4 | ||||
-rw-r--r-- | lib/chef/resource/chef_client_cron.rb | 8 |
9 files changed, 21 insertions, 20 deletions
diff --git a/lib/chef/resource/alternatives.rb b/lib/chef/resource/alternatives.rb index 576a5e0ebd..91e778b643 100644 --- a/lib/chef/resource/alternatives.rb +++ b/lib/chef/resource/alternatives.rb @@ -122,7 +122,7 @@ class Chef end end - action :install do + action :install, description: "Install an alternative on the system including symlinks" do if path_priority != new_resource.priority converge_by("adding alternative #{new_resource.link} #{new_resource.link_name} #{new_resource.path} #{new_resource.priority}") do output = shell_out(alternatives_cmd, "--install", new_resource.link, new_resource.link_name, new_resource.path, new_resource.priority) @@ -133,7 +133,7 @@ class Chef end end - action :set do + action :set, description: "Set the symlink for an alternative" do if current_path != new_resource.path converge_by("setting alternative #{new_resource.link_name} #{new_resource.path}") do output = shell_out(alternatives_cmd, "--set", new_resource.link_name, new_resource.path) @@ -144,7 +144,7 @@ class Chef end end - action :remove do + action :remove, description: "Remove an alternative and all associated links" do if path_exists? converge_by("removing alternative #{new_resource.link_name} #{new_resource.path}") do shell_out(alternatives_cmd, "--remove", new_resource.link_name, new_resource.path) @@ -152,13 +152,13 @@ class Chef end end - action :auto do + action :auto, description: "Set an alternative up in automatic mode with the highest priority automatically selected" do converge_by("setting auto alternative #{new_resource.link_name}") do shell_out(alternatives_cmd, "--auto", new_resource.link_name) end end - action :refresh do + action :refresh, description: "Refresh alternatives" do converge_by("refreshing alternative #{new_resource.link_name}") do shell_out(alternatives_cmd, "--refresh", new_resource.link_name) end diff --git a/lib/chef/resource/apt_preference.rb b/lib/chef/resource/apt_preference.rb index fd987466ea..89070dc7c5 100644 --- a/lib/chef/resource/apt_preference.rb +++ b/lib/chef/resource/apt_preference.rb @@ -91,7 +91,7 @@ class Chef end end - action :add do + action :add, description: "Creates a preferences file under `/etc/apt/preferences.d`" do return unless debian? preference = build_pref( @@ -130,7 +130,7 @@ class Chef end end - action :remove do + action :remove, description: "Removes the preferences file, thus unpinning the package" do return unless debian? sanitized_prefname = safe_name(new_resource.package_name) diff --git a/lib/chef/resource/apt_repository.rb b/lib/chef/resource/apt_repository.rb index da8ca78413..843c699f4c 100644 --- a/lib/chef/resource/apt_repository.rb +++ b/lib/chef/resource/apt_repository.rb @@ -409,7 +409,7 @@ class Chef end end - action :add do + action :add, description: "Creates a repository file at `/etc/apt/sources.list.d/` and builds the repository listing" do return unless debian? execute "apt-cache gencaches" do @@ -459,7 +459,7 @@ class Chef end end - action :remove do + action :remove, description: "Removes the repository listing" do return unless debian? cleanup_legacy_file! diff --git a/lib/chef/resource/apt_update.rb b/lib/chef/resource/apt_update.rb index e5f75143bb..fde53ec1d8 100644 --- a/lib/chef/resource/apt_update.rb +++ b/lib/chef/resource/apt_update.rb @@ -17,6 +17,7 @@ # require_relative "../resource" +require "chef-utils/dist" unless defined?(ChefUtils::Dist) class Chef class Resource @@ -85,7 +86,7 @@ class Chef end end - action :periodic do + action :periodic, description: "Update the Apt repository at the interval specified by the `frequency` property" do return unless debian? unless apt_up_to_date? @@ -95,7 +96,7 @@ class Chef end end - action :update do + action :update, description: "Update the Apt repository at the start of a #{ChefUtils::Dist::Infra::PRODUCT} run" do return unless debian? converge_by "force update new lists of packages" do diff --git a/lib/chef/resource/archive_file.rb b/lib/chef/resource/archive_file.rb index c1e51cfaa1..212835114b 100644 --- a/lib/chef/resource/archive_file.rb +++ b/lib/chef/resource/archive_file.rb @@ -67,7 +67,7 @@ class Chef property :mode, [String, Integer], description: "The mode of the extracted files. Integer values are deprecated as octal values (ex. 0755) would not be interpreted correctly.", - default: "755" + default: "755", default_description: "'755'" property :destination, String, description: "The file path to extract the archive file to.", diff --git a/lib/chef/resource/breakpoint.rb b/lib/chef/resource/breakpoint.rb index 50e2d06391..360c064ff0 100644 --- a/lib/chef/resource/breakpoint.rb +++ b/lib/chef/resource/breakpoint.rb @@ -92,7 +92,7 @@ class Chef super(caller.first, *args) end - action :break do + action :break, description: "Add a breakpoint for use with #{ChefUtils::Dist::Infra::SHELL}" do if defined?(Shell) && Shell.running? with_run_context :parent do run_context.resource_collection.iterator.pause diff --git a/lib/chef/resource/build_essential.rb b/lib/chef/resource/build_essential.rb index e17bf3bea2..84c2125cd5 100644 --- a/lib/chef/resource/build_essential.rb +++ b/lib/chef/resource/build_essential.rb @@ -119,7 +119,7 @@ class Chef end end - action :upgrade, description: "Upgrade build essential (Xcode Command Line) tools on macOS" do + action :upgrade, description: "Upgrade the Xcode CLI Tools on macOS hosts. **New in Chef Infra Client 16**" do if macos? pkg_label = xcode_cli_package_label diff --git a/lib/chef/resource/chef_client_config.rb b/lib/chef/resource/chef_client_config.rb index b3ea86c476..c9e238ce48 100644 --- a/lib/chef/resource/chef_client_config.rb +++ b/lib/chef/resource/chef_client_config.rb @@ -227,7 +227,7 @@ class Chef property :additional_config, String, description: "Additional text to add at the bottom of the client.rb config. This can be used to run custom Ruby or to add less common config options" - action :create do + action :create, description: "Create a client.rb config file" do unless ::Dir.exist?(new_resource.config_directory) directory new_resource.config_directory do user new_resource.user unless new_resource.user.nil? @@ -284,7 +284,7 @@ class Chef end end - action :remove do + action :remove, description: "Remove a client.rb config file" do file ::File.join(new_resource.config_directory, "client.rb") do action :delete end diff --git a/lib/chef/resource/chef_client_cron.rb b/lib/chef/resource/chef_client_cron.rb index 003b28d7b3..222b4043bb 100644 --- a/lib/chef/resource/chef_client_cron.rb +++ b/lib/chef/resource/chef_client_cron.rb @@ -131,11 +131,11 @@ class Chef description: "The path to the #{ChefUtils::Dist::Infra::CLIENT} binary." property :daemon_options, Array, - default: lazy { [] }, + default: lazy { [] }, default_description: "Empty Array", description: "An array of options to pass to the #{ChefUtils::Dist::Infra::CLIENT} command." property :environment, Hash, - default: lazy { {} }, + default: lazy { {} }, default_description: "Empty Hash", description: "A Hash containing additional arbitrary environment variables under which the cron job will be run in the form of `({'ENV_VARIABLE' => 'VALUE'})`." property :nice, [Integer, String], @@ -144,7 +144,7 @@ class Chef coerce: proc { |x| Integer(x) }, callbacks: { "should be an Integer between -20 and 19" => proc { |v| v >= -20 && v <= 19 } } - action :add do + action :add, description: "Add a cron job to run #{ChefUtils::Dist::Infra::PRODUCT}" do # TODO: Replace this with a :create_if_missing action on directory when that exists unless ::Dir.exist?(new_resource.log_directory) directory new_resource.log_directory do @@ -168,7 +168,7 @@ class Chef end end - action :remove do + action :remove, description: "Remove a cron job for #{ChefUtils::Dist::Infra::PRODUCT}" do declare_resource(cron_resource_type, new_resource.job_name) do action :delete end |