diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2019-07-02 11:11:35 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2019-07-02 11:13:54 -0700 |
commit | 77f8739a4741e2370e40ec39345a92a6ea393a1a (patch) | |
tree | bcf3c9a12556ce1fd18a83cd5f68cd24d36a1180 | |
parent | 90a74a80196725c4198b6042e8485d68c70777ac (diff) | |
download | chef-lcg/new-chefstyle.tar.gz |
fix Layout/AlignArgumentslcg/new-chefstyle
this is using:
Layout/AlignArguments:
Enabled: true
EnforcedStyle: with_fixed_indentation
the default style can use really excessive whitespace. on starting
lines which are already long, it fully indents across to where the
arguments start and then begins the line there.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
180 files changed, 1698 insertions, 1698 deletions
diff --git a/lib/chef/api_client/registration.rb b/lib/chef/api_client/registration.rb index 2f50983032..dc4bb4e57a 100644 --- a/lib/chef/api_client/registration.rb +++ b/lib/chef/api_client/registration.rb @@ -156,11 +156,11 @@ class Chef def http_api @http_api ||= Chef::ServerAPI.new(Chef::Config[:chef_server_url], - { - api_version: "0", - client_name: Chef::Config[:validation_client_name], - signing_key_filename: Chef::Config[:validation_key], - } + { + api_version: "0", + client_name: Chef::Config[:validation_client_name], + signing_key_filename: Chef::Config[:validation_key], + } ) end diff --git a/lib/chef/environment.rb b/lib/chef/environment.rb index 9dd1aa408a..0e0f6776ec 100644 --- a/lib/chef/environment.rb +++ b/lib/chef/environment.rb @@ -307,7 +307,7 @@ class Chef def self.validate_cookbook_version(version) if Chef::Config[:solo_legacy_mode] raise Chef::Exceptions::IllegalVersionConstraint, - "Environment cookbook version constraints not allowed in #{Chef::Dist::SOLO}" + "Environment cookbook version constraints not allowed in #{Chef::Dist::SOLO}" else Chef::VersionConstraint.new version true diff --git a/lib/chef/http/basic_client.rb b/lib/chef/http/basic_client.rb index 3cbfc8c968..ef1de373d6 100644 --- a/lib/chef/http/basic_client.rb +++ b/lib/chef/http/basic_client.rb @@ -135,7 +135,7 @@ class Chef else Chef::Log.trace("Using #{proxy_uri.host}:#{proxy_uri.port} for proxy") Net::HTTP.Proxy(proxy_uri.host, proxy_uri.port, http_proxy_user(proxy_uri), - http_proxy_pass(proxy_uri)) + http_proxy_pass(proxy_uri)) end end diff --git a/lib/chef/key.rb b/lib/chef/key.rb index 1d475d5c1b..7f4591c2c7 100644 --- a/lib/chef/key.rb +++ b/lib/chef/key.rb @@ -77,23 +77,23 @@ class Chef def actor(arg = nil) set_or_return(:actor, arg, - regex: /^[a-z0-9\-_]+$/) + regex: /^[a-z0-9\-_]+$/) end def name(arg = nil) set_or_return(:name, arg, - kind_of: String) + kind_of: String) end def public_key(arg = nil) raise Chef::Exceptions::InvalidKeyAttribute, "you cannot set the public_key if create_key is true" if !arg.nil? && @create_key set_or_return(:public_key, arg, - kind_of: String) + kind_of: String) end def private_key(arg = nil) set_or_return(:private_key, arg, - kind_of: String) + kind_of: String) end def delete_public_key @@ -107,12 +107,12 @@ class Chef def create_key(arg = nil) raise Chef::Exceptions::InvalidKeyAttribute, "you cannot set create_key to true if the public_key field exists" if arg == true && !@public_key.nil? set_or_return(:create_key, arg, - kind_of: [TrueClass, FalseClass]) + kind_of: [TrueClass, FalseClass]) end def expiration_date(arg = nil) set_or_return(:expiration_date, arg, - regex: /^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z|infinity)$/) + regex: /^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z|infinity)$/) end def to_h diff --git a/lib/chef/knife/bootstrap.rb b/lib/chef/knife/bootstrap.rb index 19384ba768..13f8731c77 100644 --- a/lib/chef/knife/bootstrap.rb +++ b/lib/chef/knife/bootstrap.rb @@ -864,9 +864,9 @@ class Chef # Common configuration for all protocols def base_opts port = config_value(:connection_port, - knife_key_for_protocol(connection_protocol, :port)) + knife_key_for_protocol(connection_protocol, :port)) user = config_value(:connection_user, - knife_key_for_protocol(connection_protocol, :user)) + knife_key_for_protocol(connection_protocol, :user)) {}.tap do |opts| opts[:logger] = Chef::Log # We do not store password in Chef::Config, so only use CLI `config` here diff --git a/lib/chef/knife/client_bulk_delete.rb b/lib/chef/knife/client_bulk_delete.rb index 28278eb89c..703ccb7747 100644 --- a/lib/chef/knife/client_bulk_delete.rb +++ b/lib/chef/knife/client_bulk_delete.rb @@ -27,9 +27,9 @@ class Chef end option :delete_validators, - short: "-D", - long: "--delete-validators", - description: "Force deletion of clients if they're validators." + short: "-D", + long: "--delete-validators", + description: "Force deletion of clients if they're validators." banner "knife client bulk delete REGEX (options)" diff --git a/lib/chef/knife/client_create.rb b/lib/chef/knife/client_create.rb index 05aafd446e..32ee846d52 100644 --- a/lib/chef/knife/client_create.rb +++ b/lib/chef/knife/client_create.rb @@ -28,25 +28,25 @@ class Chef end option :file, - short: "-f FILE", - long: "--file FILE", - description: "Write the private key to a file if the #{Chef::Dist::SERVER_PRODUCT} generated one." + short: "-f FILE", + long: "--file FILE", + description: "Write the private key to a file if the #{Chef::Dist::SERVER_PRODUCT} generated one." option :validator, - long: "--validator", - description: "Create the client as a validator.", - boolean: true + long: "--validator", + description: "Create the client as a validator.", + boolean: true option :public_key, - short: "-p FILE", - long: "--public-key", - description: "Set the initial default key for the client from a file on disk (cannot pass with --prevent-keygen)." + short: "-p FILE", + long: "--public-key", + description: "Set the initial default key for the client from a file on disk (cannot pass with --prevent-keygen)." option :prevent_keygen, - short: "-k", - long: "--prevent-keygen", - description: "Prevent #{Chef::Dist::SERVER_PRODUCT} from generating a default key pair for you. Cannot be passed with --public-key.", - boolean: true + short: "-k", + long: "--prevent-keygen", + description: "Prevent #{Chef::Dist::SERVER_PRODUCT} from generating a default key pair for you. Cannot be passed with --public-key.", + boolean: true banner "knife client create CLIENTNAME (options)" diff --git a/lib/chef/knife/client_delete.rb b/lib/chef/knife/client_delete.rb index 23f34e65b4..bd3331f7db 100644 --- a/lib/chef/knife/client_delete.rb +++ b/lib/chef/knife/client_delete.rb @@ -27,9 +27,9 @@ class Chef end option :delete_validators, - short: "-D", - long: "--delete-validators", - description: "Force deletion of client if it's a validator." + short: "-D", + long: "--delete-validators", + description: "Force deletion of client if it's a validator." banner "knife client delete [CLIENT [CLIENT]] (options)" diff --git a/lib/chef/knife/config_get.rb b/lib/chef/knife/config_get.rb index f21033d793..b07bef9a36 100644 --- a/lib/chef/knife/config_get.rb +++ b/lib/chef/knife/config_get.rb @@ -25,16 +25,16 @@ class Chef banner "knife config get [OPTION...] (options)\nDisplays the value of Chef::Config[OPTION] (or all config values)" option :all, - short: "-a", - long: "--all", - description: "Include options that are not set in the configuration.", - default: false + short: "-a", + long: "--all", + description: "Include options that are not set in the configuration.", + default: false option :raw, - short: "-r", - long: "--raw", - description: "Display a each value with no formatting.", - default: false + short: "-r", + long: "--raw", + description: "Display a each value with no formatting.", + default: false def run if config[:format] == "summary" && !config[:raw] diff --git a/lib/chef/knife/config_list_profiles.rb b/lib/chef/knife/config_list_profiles.rb index 29e3e24dc5..fb40b30b0a 100644 --- a/lib/chef/knife/config_list_profiles.rb +++ b/lib/chef/knife/config_list_profiles.rb @@ -24,10 +24,10 @@ class Chef banner "knife config list-profiles (options)" option :ignore_knife_rb, - short: "-i", - long: "--ignore-knife-rb", - description: "Ignore the current config.rb/knife.rb configuration.", - default: false + short: "-i", + long: "--ignore-knife-rb", + description: "Ignore the current config.rb/knife.rb configuration.", + default: false def run credentials_data = self.class.config_loader.parse_credentials_file diff --git a/lib/chef/knife/cookbook_download.rb b/lib/chef/knife/cookbook_download.rb index 09f420ffe5..2da5e138a3 100644 --- a/lib/chef/knife/cookbook_download.rb +++ b/lib/chef/knife/cookbook_download.rb @@ -33,21 +33,21 @@ class Chef banner "knife cookbook download COOKBOOK [VERSION] (options)" option :latest, - short: "-N", - long: "--latest", - description: "The version of the cookbook to download.", - boolean: true + short: "-N", + long: "--latest", + description: "The version of the cookbook to download.", + boolean: true option :download_directory, - short: "-d DOWNLOAD_DIRECTORY", - long: "--dir DOWNLOAD_DIRECTORY", - description: "The directory to download the cookbook into.", - default: Dir.pwd + short: "-d DOWNLOAD_DIRECTORY", + long: "--dir DOWNLOAD_DIRECTORY", + description: "The directory to download the cookbook into.", + default: Dir.pwd option :force, - short: "-f", - long: "--force", - description: "Force download over the download directory if it exists." + short: "-f", + long: "--force", + description: "Force download over the download directory if it exists." # TODO: tim/cw: 5-23-2010: need to implement knife-side # specificity for downloads - need to implement --platform and diff --git a/lib/chef/knife/cookbook_show.rb b/lib/chef/knife/cookbook_show.rb index 9129e61e7e..d1e7220650 100644 --- a/lib/chef/knife/cookbook_show.rb +++ b/lib/chef/knife/cookbook_show.rb @@ -31,19 +31,19 @@ class Chef banner "knife cookbook show COOKBOOK [VERSION] [PART] [FILENAME] (options)" option :fqdn, - short: "-f FQDN", - long: "--fqdn FQDN", - description: "The FQDN of the host to see the file for." + short: "-f FQDN", + long: "--fqdn FQDN", + description: "The FQDN of the host to see the file for." option :platform, - short: "-p PLATFORM", - long: "--platform PLATFORM", - description: "The platform to see the file for." + short: "-p PLATFORM", + long: "--platform PLATFORM", + description: "The platform to see the file for." option :platform_version, - short: "-V VERSION", - long: "--platform-version VERSION", - description: "The platform version to see the file for." + short: "-V VERSION", + long: "--platform-version VERSION", + description: "The platform version to see the file for." option :with_uri, short: "-w", diff --git a/lib/chef/knife/core/subcommand_loader.rb b/lib/chef/knife/core/subcommand_loader.rb index bb84c55dd9..f2dc06ce36 100644 --- a/lib/chef/knife/core/subcommand_loader.rb +++ b/lib/chef/knife/core/subcommand_loader.rb @@ -108,7 +108,7 @@ class Chef cmd_words = positional_arguments(args) load_command(cmd_words) result = Chef::Knife.subcommands[find_longest_key(Chef::Knife.subcommands, - cmd_words, "_")] + cmd_words, "_")] result || Chef::Knife.subcommands[args.first.tr("-", "_")] end @@ -116,7 +116,7 @@ class Chef category_words = positional_arguments(args) category_words.map! { |w| w.split("-") }.flatten! find_longest_key(Chef::Knife.subcommands_by_category, - category_words, " ") + category_words, " ") end # diff --git a/lib/chef/knife/data_bag_secret_options.rb b/lib/chef/knife/data_bag_secret_options.rb index d04be7d448..4b4cb8a7e1 100644 --- a/lib/chef/knife/data_bag_secret_options.rb +++ b/lib/chef/knife/data_bag_secret_options.rb @@ -35,23 +35,23 @@ class Chef def self.included(base) base.option :secret, - short: "-s SECRET", - long: "--secret ", - description: "The secret key to use to encrypt data bag item values. Can also be defaulted in your config with the key 'secret'.", - # Need to store value from command line in separate variable - knife#merge_configs populates same keys - # on config object from - proc: Proc.new { |s| set_cl_secret(s) } + short: "-s SECRET", + long: "--secret ", + description: "The secret key to use to encrypt data bag item values. Can also be defaulted in your config with the key 'secret'.", + # Need to store value from command line in separate variable - knife#merge_configs populates same keys + # on config object from + proc: Proc.new { |s| set_cl_secret(s) } base.option :secret_file, - long: "--secret-file SECRET_FILE", - description: "A file containing the secret key to use to encrypt data bag item values. Can also be defaulted in your config with the key 'secret_file'.", - proc: Proc.new { |sf| set_cl_secret_file(sf) } + long: "--secret-file SECRET_FILE", + description: "A file containing the secret key to use to encrypt data bag item values. Can also be defaulted in your config with the key 'secret_file'.", + proc: Proc.new { |sf| set_cl_secret_file(sf) } base.option :encrypt, - long: "--encrypt", - description: "If 'secret' or 'secret_file' is present in your config, then encrypt data bags using it.", - boolean: true, - default: false + long: "--encrypt", + description: "If 'secret' or 'secret_file' is present in your config, then encrypt data bags using it.", + boolean: true, + default: false end def encryption_secret_provided? diff --git a/lib/chef/knife/data_bag_show.rb b/lib/chef/knife/data_bag_show.rb index 529b0fafcf..aad94745dc 100644 --- a/lib/chef/knife/data_bag_show.rb +++ b/lib/chef/knife/data_bag_show.rb @@ -44,8 +44,8 @@ class Chef # Users do not need to pass --encrypt to read data, we simply try to use the provided secret ui.info("Encrypted data bag detected, decrypting with provided secret.") raw = Chef::EncryptedDataBagItem.load(@name_args[0], - @name_args[1], - secret) + @name_args[1], + secret) format_for_display(raw.to_h) elsif encrypted && !secret ui.warn("Encrypted data bag detected, but no secret provided for decoding. Displaying encrypted data.") diff --git a/lib/chef/knife/environment_from_file.rb b/lib/chef/knife/environment_from_file.rb index 3d476a4712..2ab3e1e670 100644 --- a/lib/chef/knife/environment_from_file.rb +++ b/lib/chef/knife/environment_from_file.rb @@ -30,9 +30,9 @@ class Chef banner "knife environment from file FILE [FILE..] (options)" option :all, - short: "-a", - long: "--all", - description: "Upload all environments." + short: "-a", + long: "--all", + description: "Upload all environments." def loader @loader ||= Knife::Core::ObjectLoader.new(Chef::Environment, ui) diff --git a/lib/chef/knife/key_create_base.rb b/lib/chef/knife/key_create_base.rb index d69f442e71..81630f584a 100644 --- a/lib/chef/knife/key_create_base.rb +++ b/lib/chef/knife/key_create_base.rb @@ -25,24 +25,24 @@ class Chef def self.included(includer) includer.class_eval do option :public_key, - short: "-p FILENAME", - long: "--public-key FILENAME", - description: "Public key for newly created key. If not passed, the server will create a key pair for you, but you must pass --key-name NAME in that case." + short: "-p FILENAME", + long: "--public-key FILENAME", + description: "Public key for newly created key. If not passed, the server will create a key pair for you, but you must pass --key-name NAME in that case." option :file, - short: "-f FILE", - long: "--file FILE", - description: "Write the private key to a file, if you requested the server to create one." + short: "-f FILE", + long: "--file FILE", + description: "Write the private key to a file, if you requested the server to create one." option :key_name, - short: "-k NAME", - long: "--key-name NAME", - description: "The name for your key. If you do not pass a name, you must pass --public-key, and the name will default to the fingerprint of the public key passed." + short: "-k NAME", + long: "--key-name NAME", + description: "The name for your key. If you do not pass a name, you must pass --public-key, and the name will default to the fingerprint of the public key passed." option :expiration_date, - short: "-e DATE", - long: "--expiration-date DATE", - description: "Optionally pass the expiration date for the key in ISO 8601 fomatted string: YYYY-MM-DDTHH:MM:SSZ e.g. 2013-12-24T21:00:00Z. Defaults to infinity if not passed. UTC timezone assumed." + short: "-e DATE", + long: "--expiration-date DATE", + description: "Optionally pass the expiration date for the key in ISO 8601 fomatted string: YYYY-MM-DDTHH:MM:SSZ e.g. 2013-12-24T21:00:00Z. Defaults to infinity if not passed. UTC timezone assumed." end end end diff --git a/lib/chef/knife/key_edit_base.rb b/lib/chef/knife/key_edit_base.rb index ecdb4b0038..df3529b7db 100644 --- a/lib/chef/knife/key_edit_base.rb +++ b/lib/chef/knife/key_edit_base.rb @@ -25,29 +25,29 @@ class Chef def self.included(includer) includer.class_eval do option :public_key, - short: "-p FILENAME", - long: "--public-key FILENAME", - description: "Replace the public_key field from a file on disk. If not passed, the public_key field will not change." + short: "-p FILENAME", + long: "--public-key FILENAME", + description: "Replace the public_key field from a file on disk. If not passed, the public_key field will not change." option :create_key, - short: "-c", - long: "--create-key", - description: "Replace the public_key field with a key generated by the server. The private key will be returned." + short: "-c", + long: "--create-key", + description: "Replace the public_key field with a key generated by the server. The private key will be returned." option :file, - short: "-f FILE", - long: "--file FILE", - description: "Write the private key to a file, if you requested the server to create one via --create-key." + short: "-f FILE", + long: "--file FILE", + description: "Write the private key to a file, if you requested the server to create one via --create-key." option :key_name, - short: "-k NAME", - long: "--key-name NAME", - description: "The new name for your key. Pass if you wish to update the name field of your key." + short: "-k NAME", + long: "--key-name NAME", + description: "The new name for your key. Pass if you wish to update the name field of your key." option :expiration_date, - short: "-e DATE", - long: "--expiration-date DATE", - description: "Updates the expiration_date field of your key if passed. Pass in ISO 8601 fomatted string: YYYY-MM-DDTHH:MM:SSZ e.g. 2013-12-24T21:00:00Z or infinity. UTC timezone assumed." + short: "-e DATE", + long: "--expiration-date DATE", + description: "Updates the expiration_date field of your key if passed. Pass in ISO 8601 fomatted string: YYYY-MM-DDTHH:MM:SSZ e.g. 2013-12-24T21:00:00Z or infinity. UTC timezone assumed." end end end diff --git a/lib/chef/knife/key_list_base.rb b/lib/chef/knife/key_list_base.rb index 6470bf78ad..fb9db65103 100644 --- a/lib/chef/knife/key_list_base.rb +++ b/lib/chef/knife/key_list_base.rb @@ -25,19 +25,19 @@ class Chef def self.included(includer) includer.class_eval do option :with_details, - short: "-w", - long: "--with-details", - description: "Show corresponding URIs and whether the key has expired or not." + short: "-w", + long: "--with-details", + description: "Show corresponding URIs and whether the key has expired or not." option :only_expired, - short: "-e", - long: "--only-expired", - description: "Only show expired keys." + short: "-e", + long: "--only-expired", + description: "Only show expired keys." option :only_non_expired, - short: "-n", - long: "--only-non-expired", - description: "Only show non-expired keys." + short: "-n", + long: "--only-non-expired", + description: "Only show non-expired keys." end end end diff --git a/lib/chef/knife/supermarket_install.rb b/lib/chef/knife/supermarket_install.rb index f47917e13d..b0b8fbe1aa 100644 --- a/lib/chef/knife/supermarket_install.rb +++ b/lib/chef/knife/supermarket_install.rb @@ -34,11 +34,11 @@ class Chef category "supermarket" option :no_deps, - short: "-D", - long: "--skip-dependencies", - boolean: true, - default: false, - description: "Skips automatic dependency installation." + short: "-D", + long: "--skip-dependencies", + boolean: true, + default: false, + description: "Skips automatic dependency installation." option :cookbook_path, short: "-o PATH:PATH", diff --git a/lib/chef/mixin/homebrew_user.rb b/lib/chef/mixin/homebrew_user.rb index 7703538ff7..82dbb36f6c 100644 --- a/lib/chef/mixin/homebrew_user.rb +++ b/lib/chef/mixin/homebrew_user.rb @@ -67,7 +67,7 @@ class Chef owner = ::File.stat(brew_path).uid else raise Chef::Exceptions::CannotDetermineHomebrewOwner, - 'Could not find the "brew" executable in /usr/local/bin or anywhere on the path.' + 'Could not find the "brew" executable in /usr/local/bin or anywhere on the path.' end Chef::Log.debug "Found Homebrew owner #{Etc.getpwuid(owner).name}; executing `brew` commands as them" diff --git a/lib/chef/mixin/openssl_helper.rb b/lib/chef/mixin/openssl_helper.rb index 79ab9596e5..2312d606ad 100644 --- a/lib/chef/mixin/openssl_helper.rb +++ b/lib/chef/mixin/openssl_helper.rb @@ -284,7 +284,7 @@ class Chef cert.extensions = extension cert.add_extension ef.create_extension("subjectKeyIdentifier", "hash") cert.add_extension ef.create_extension("authorityKeyIdentifier", - "keyid:always,issuer:always") + "keyid:always,issuer:always") cert.sign(key, ::OpenSSL::Digest::SHA256.new) cert @@ -315,7 +315,7 @@ class Chef crl.add_extension ::OpenSSL::X509::Extension.new("crlNumber", ::OpenSSL::ASN1::Integer(1)) crl.add_extension ef.create_extension("authorityKeyIdentifier", - "keyid:always,issuer:always") + "keyid:always,issuer:always") crl.sign(ca_private_key, ::OpenSSL::Digest::SHA256.new) crl end @@ -361,7 +361,7 @@ class Chef revoked.time = Time.now ext = ::OpenSSL::X509::Extension.new("CRLReason", - ::OpenSSL::ASN1::Enumerated(revoke_info["reason"])) + ::OpenSSL::ASN1::Enumerated(revoke_info["reason"])) revoked.add_extension(ext) crl.add_revoked(revoked) @@ -391,9 +391,9 @@ class Chef ef.issuer_certificate = info["issuer"] crl.extensions = [ ::OpenSSL::X509::Extension.new("crlNumber", - ::OpenSSL::ASN1::Integer(get_next_crl_number(crl)))] + ::OpenSSL::ASN1::Integer(get_next_crl_number(crl)))] crl.add_extension ef.create_extension("authorityKeyIdentifier", - "keyid:always,issuer:always") + "keyid:always,issuer:always") crl.sign(ca_private_key, ::OpenSSL::Digest::SHA256.new) crl end diff --git a/lib/chef/mixin/windows_architecture_helper.rb b/lib/chef/mixin/windows_architecture_helper.rb index 44056900a4..96e1b8d34e 100644 --- a/lib/chef/mixin/windows_architecture_helper.rb +++ b/lib/chef/mixin/windows_architecture_helper.rb @@ -84,7 +84,7 @@ class Chef def assert_valid_windows_architecture!(architecture) if !valid_windows_architecture?(architecture) raise Chef::Exceptions::Win32ArchitectureIncorrect, - "The specified architecture was not valid. It must be one of :i386 or :x86_64" + "The specified architecture was not valid. It must be one of :i386 or :x86_64" end end diff --git a/lib/chef/monkey_patches/webrick-utils.rb b/lib/chef/monkey_patches/webrick-utils.rb index 7f525f122f..c90c9fe251 100644 --- a/lib/chef/monkey_patches/webrick-utils.rb +++ b/lib/chef/monkey_patches/webrick-utils.rb @@ -25,10 +25,10 @@ module WEBrick raise ArgumentError, "must specify port" end res = Socket.getaddrinfo(address, port, - Socket::AF_UNSPEC, # address family - Socket::SOCK_STREAM, # socket type - 0, # protocol - Socket::AI_PASSIVE) # flag + Socket::AF_UNSPEC, # address family + Socket::SOCK_STREAM, # socket type + 0, # protocol + Socket::AI_PASSIVE) # flag last_error = nil sockets = [] res.each do |ai| diff --git a/lib/chef/node.rb b/lib/chef/node.rb index a9010d9287..a6a7c06dc4 100644 --- a/lib/chef/node.rb +++ b/lib/chef/node.rb @@ -116,11 +116,11 @@ class Chef def name(arg = nil) if !arg.nil? validate( - { name: arg }, - { name: { kind_of: String, - cannot_be: :blank, - regex: /^[\-[:alnum:]_:.]+$/ }, - }) + { name: arg }, + { name: { kind_of: String, + cannot_be: :blank, + regex: /^[\-[:alnum:]_:.]+$/ }, + }) @name = arg else @name diff --git a/lib/chef/org.rb b/lib/chef/org.rb index d482ca504f..1b47e1f255 100644 --- a/lib/chef/org.rb +++ b/lib/chef/org.rb @@ -40,22 +40,22 @@ class Chef def name(arg = nil) set_or_return(:name, arg, - regex: /^[a-z0-9\-_]+$/) + regex: /^[a-z0-9\-_]+$/) end def full_name(arg = nil) set_or_return(:full_name, - arg, kind_of: String) + arg, kind_of: String) end def private_key(arg = nil) set_or_return(:private_key, - arg, kind_of: String) + arg, kind_of: String) end def guid(arg = nil) set_or_return(:guid, - arg, kind_of: String) + arg, kind_of: String) end def to_h diff --git a/lib/chef/policy_builder/expand_node_object.rb b/lib/chef/policy_builder/expand_node_object.rb index 5230105ac1..fceec9d873 100644 --- a/lib/chef/policy_builder/expand_node_object.rb +++ b/lib/chef/policy_builder/expand_node_object.rb @@ -184,7 +184,7 @@ class Chef begin events.cookbook_resolution_start(@expanded_run_list_with_versions) cookbook_hash = api_service.post("environments/#{node.chef_environment}/cookbook_versions", - { run_list: @expanded_run_list_with_versions }) + { run_list: @expanded_run_list_with_versions }) cookbook_hash = cookbook_hash.inject({}) do |memo, (key, value)| memo[key] = Chef::CookbookVersion.from_hash(value) @@ -249,7 +249,7 @@ class Chef def api_service @api_service ||= Chef::ServerAPI.new(config[:chef_server_url], - { version_class: Chef::CookbookManifestVersions }) + { version_class: Chef::CookbookManifestVersions }) end def config diff --git a/lib/chef/policy_builder/policyfile.rb b/lib/chef/policy_builder/policyfile.rb index e60457e145..3e1a2e81c6 100644 --- a/lib/chef/policy_builder/policyfile.rb +++ b/lib/chef/policy_builder/policyfile.rb @@ -500,7 +500,7 @@ class Chef # @api private def api_service @api_service ||= Chef::ServerAPI.new(config[:chef_server_url], - { version_class: Chef::CookbookManifestVersions }) + { version_class: Chef::CookbookManifestVersions }) end # @api private diff --git a/lib/chef/provider/git.rb b/lib/chef/provider/git.rb index 2d8cfbc877..4d39485a62 100644 --- a/lib/chef/provider/git.rb +++ b/lib/chef/provider/git.rb @@ -53,7 +53,7 @@ class Chef requirements.assert(:all_actions) do |a| a.assertion { !(new_resource.revision =~ /^origin\//) } a.failure_message Chef::Exceptions::InvalidRemoteGitReference, - "Deploying remote branches is not supported. " + + "Deploying remote branches is not supported. " + "Specify the remote branch as a local branch for " + "the git repository you're deploying from " + "(ie: '#{new_resource.revision.gsub('origin/', '')}' rather than '#{new_resource.revision}')." diff --git a/lib/chef/provider/service/windows.rb b/lib/chef/provider/service/windows.rb index d4f649ae28..adb214711a 100644 --- a/lib/chef/provider/service/windows.rb +++ b/lib/chef/provider/service/windows.rb @@ -103,7 +103,7 @@ class Chef::Provider::Service::Windows < Chef::Provider::Service if ex.errno == ERROR_SERVICE_LOGON_FAILED logger.error ex.message raise Chef::Exceptions::Service, - "Service #{@new_resource} did not start due to a logon failure (error #{ERROR_SERVICE_LOGON_FAILED}): possibly the specified user '#{@new_resource.run_as_user}' does not have the 'log on as a service' privilege, or the password is incorrect." + "Service #{@new_resource} did not start due to a logon failure (error #{ERROR_SERVICE_LOGON_FAILED}): possibly the specified user '#{@new_resource.run_as_user}' does not have the 'log on as a service' privilege, or the password is incorrect." else raise ex end @@ -209,8 +209,8 @@ class Chef::Provider::Service::Windows < Chef::Provider::Service end converge_if_changed :service_type, :startup_type, :error_control, - :binary_path_name, :load_order_group, :dependencies, - :run_as_user, :display_name, :description do + :binary_path_name, :load_order_group, :dependencies, + :run_as_user, :display_name, :description do Win32::Service.configure(windows_service_config(:configure)) end diff --git a/lib/chef/provider/user/dscl.rb b/lib/chef/provider/user/dscl.rb index f5da8e695b..1ec80af039 100644 --- a/lib/chef/provider/user/dscl.rb +++ b/lib/chef/provider/user/dscl.rb @@ -343,7 +343,7 @@ in 'password', with the associated 'salt' and 'iterations'.") # Shadow info is saved as binary plist. Convert the info to binary plist. shadow_info_binary = StringIO.new shell_out("plutil", "-convert", "binary1", "-o", "-", "-", - input: shadow_info.to_plist, live_stream: shadow_info_binary) + input: shadow_info.to_plist, live_stream: shadow_info_binary) if user_info.nil? # User is just created. read_user_info() will read the fresh information diff --git a/lib/chef/resource/apt_package.rb b/lib/chef/resource/apt_package.rb index dace0add45..b94c480a29 100644 --- a/lib/chef/resource/apt_package.rb +++ b/lib/chef/resource/apt_package.rb @@ -28,21 +28,21 @@ class Chef description "Use the apt_package resource to manage packages on Debian and Ubuntu platforms." property :default_release, String, - description: "The default release. For example: stable.", - desired_state: false + description: "The default release. For example: stable.", + desired_state: false property :overwrite_config_files, [TrueClass, FalseClass], - introduced: "14.0", - description: "Overwrite existing configuration files with those supplied by the package, if prompted by APT.", - default: false + introduced: "14.0", + description: "Overwrite existing configuration files with those supplied by the package, if prompted by APT.", + default: false property :response_file, String, - description: "The direct path to the file used to pre-seed a package.", - desired_state: false + description: "The direct path to the file used to pre-seed a package.", + desired_state: false property :response_file_variables, Hash, - description: "A Hash of response file variables in the form of {'VARIABLE' => 'VALUE'}.", - default: lazy { Hash.new }, desired_state: false + description: "A Hash of response file variables in the form of {'VARIABLE' => 'VALUE'}.", + default: lazy { Hash.new }, desired_state: false end end diff --git a/lib/chef/resource/apt_preference.rb b/lib/chef/resource/apt_preference.rb index aebf1af763..810a8dcad8 100644 --- a/lib/chef/resource/apt_preference.rb +++ b/lib/chef/resource/apt_preference.rb @@ -29,21 +29,21 @@ class Chef introduced "13.3" property :package_name, String, - name_property: true, - description: "An optional property to set the package name if it differs from the resource block's name.", - regex: [/^([a-z]|[A-Z]|[0-9]|_|-|\.|\*|\+)+$/], - validation_message: "The provided package name is not valid. Package names can only contain alphanumeric characters as well as _, -, +, or *!" + name_property: true, + description: "An optional property to set the package name if it differs from the resource block's name.", + regex: [/^([a-z]|[A-Z]|[0-9]|_|-|\.|\*|\+)+$/], + validation_message: "The provided package name is not valid. Package names can only contain alphanumeric characters as well as _, -, +, or *!" property :glob, String, - description: "Pin by glob() expression or with regular expressions surrounded by /." + description: "Pin by glob() expression or with regular expressions surrounded by /." property :pin, String, - description: "The package version or repository to pin.", - required: true + description: "The package version or repository to pin.", + required: true property :pin_priority, [String, Integer], - description: "Sets the Pin-Priority for a package.", - required: true + description: "Sets the Pin-Priority for a package.", + required: true default_action :add allowed_actions :add, :remove diff --git a/lib/chef/resource/apt_repository.rb b/lib/chef/resource/apt_repository.rb index a182562dc0..c70631253b 100644 --- a/lib/chef/resource/apt_repository.rb +++ b/lib/chef/resource/apt_repository.rb @@ -33,51 +33,51 @@ class Chef # defaults, but since we allowed users to pass nil here we need to continue # to allow that so don't refactor this however tempting it is property :repo_name, String, - regex: [/^[^\/]+$/], - description: "An optional property to set the repository name if it differs from the resource block's name. The value of this setting must not contain spaces.", - validation_message: "repo_name property cannot contain a forward slash '/'", - introduced: "14.1", name_property: true + regex: [/^[^\/]+$/], + description: "An optional property to set the repository name if it differs from the resource block's name. The value of this setting must not contain spaces.", + validation_message: "repo_name property cannot contain a forward slash '/'", + introduced: "14.1", name_property: true property :uri, String, - description: "The base of the Debian distribution." + description: "The base of the Debian distribution." property :distribution, [ String, nil, FalseClass ], - description: "Usually a distribution's codename, such as trusty, xenial or bionic. Default value: the codename of the node's distro.", - default: lazy { node["lsb"]["codename"] }, default_description: "The LSB codename of the host such as 'bionic'." + description: "Usually a distribution's codename, such as trusty, xenial or bionic. Default value: the codename of the node's distro.", + default: lazy { node["lsb"]["codename"] }, default_description: "The LSB codename of the host such as 'bionic'." property :components, Array, - description: "Package groupings, such as 'main' and 'stable'.", - default: lazy { [] } + description: "Package groupings, such as 'main' and 'stable'.", + default: lazy { [] } property :arch, [String, nil, FalseClass], - description: "Constrain packages to a particular CPU architecture such as 'i386' or 'amd64'." + description: "Constrain packages to a particular CPU architecture such as 'i386' or 'amd64'." property :trusted, [TrueClass, FalseClass], - description: "Determines whether you should treat all packages from this repository as authenticated regardless of signature.", - default: false + description: "Determines whether you should treat all packages from this repository as authenticated regardless of signature.", + default: false property :deb_src, [TrueClass, FalseClass], - description: "Determines whether or not to add the repository as a source repo as well.", - default: false + description: "Determines whether or not to add the repository as a source repo as well.", + default: false property :keyserver, [String, nil, FalseClass], - description: "The GPG keyserver where the key for the repo should be retrieved.", - default: "keyserver.ubuntu.com" + description: "The GPG keyserver where the key for the repo should be retrieved.", + default: "keyserver.ubuntu.com" property :key, [String, Array, nil, FalseClass], - description: "If a keyserver is provided, this is assumed to be the fingerprint; otherwise it can be either the URI of GPG key for the repo, or a cookbook_file.", - default: lazy { [] }, coerce: proc { |x| x ? Array(x) : x } + description: "If a keyserver is provided, this is assumed to be the fingerprint; otherwise it can be either the URI of GPG key for the repo, or a cookbook_file.", + default: lazy { [] }, coerce: proc { |x| x ? Array(x) : x } property :key_proxy, [String, nil, FalseClass], - description: "If set, a specified proxy is passed to GPG via http-proxy=." + description: "If set, a specified proxy is passed to GPG via http-proxy=." property :cookbook, [String, nil, FalseClass], - description: "If key should be a cookbook_file, specify a cookbook where the key is located for files/default. Default value is nil, so it will use the cookbook where the resource is used.", - desired_state: false + description: "If key should be a cookbook_file, specify a cookbook where the key is located for files/default. Default value is nil, so it will use the cookbook where the resource is used.", + desired_state: false property :cache_rebuild, [TrueClass, FalseClass], - description: "Determines whether to rebuild the APT package cache.", - default: true, desired_state: false + description: "Determines whether to rebuild the APT package cache.", + default: true, desired_state: false default_action :add allowed_actions :add, :remove diff --git a/lib/chef/resource/apt_update.rb b/lib/chef/resource/apt_update.rb index baafd5a797..e11d35664f 100644 --- a/lib/chef/resource/apt_update.rb +++ b/lib/chef/resource/apt_update.rb @@ -31,8 +31,8 @@ class Chef property :name, String, default: "" property :frequency, Integer, - description: "Determines how frequently (in seconds) APT repository updates are made. Use this property when the :periodic action is specified.", - default: 86_400 + description: "Determines how frequently (in seconds) APT repository updates are made. Use this property when the :periodic action is specified.", + default: 86_400 default_action :periodic allowed_actions :update, :periodic diff --git a/lib/chef/resource/archive_file.rb b/lib/chef/resource/archive_file.rb index 18a6a2d5a0..958da23a1b 100644 --- a/lib/chef/resource/archive_file.rb +++ b/lib/chef/resource/archive_file.rb @@ -32,31 +32,31 @@ class Chef description "Use the archive_file resource to extract archive files to disk. This resource uses the libarchive library to extract multiple archive formats including tar, gzip, bzip, and zip formats." property :path, String, - name_property: true, - coerce: proc { |f| ::File.expand_path(f) }, - description: "An optional property to set the file path to the archive to extract if it differs from the resource block's name." + name_property: true, + coerce: proc { |f| ::File.expand_path(f) }, + description: "An optional property to set the file path to the archive to extract if it differs from the resource block's name." property :owner, String, - description: "The owner of the extracted files." + description: "The owner of the extracted files." property :group, String, - description: "The group of the extracted files." + description: "The group of the extracted files." property :mode, [String, Integer], - description: "The mode of the extracted files.", - default: "755" + description: "The mode of the extracted files.", + default: "755" property :destination, String, - description: "The file path to extract the archive file to.", - required: true + description: "The file path to extract the archive file to.", + required: true property :options, [Array, Symbol], - description: "An array of symbols representing extraction flags. Example: :no_overwrite to prevent overwriting files on disk. By default, this properly sets :time which preserves the modification timestamps of files in the archive when writing them to disk.", - default: lazy { [:time] } + description: "An array of symbols representing extraction flags. Example: :no_overwrite to prevent overwriting files on disk. By default, this properly sets :time which preserves the modification timestamps of files in the archive when writing them to disk.", + default: lazy { [:time] } property :overwrite, [TrueClass, FalseClass, :auto], - description: "Should the resource overwrite the destination file contents if they already exist? If set to :auto the date stamp of files within the archive will be compared to those on disk and disk contents will be overwritten if they differ. This may cause unintended consequences if disk date stamps are changed between runs, which will result in the files being overwritten during each client run. Make sure to properly test any change to this property.", - default: false + description: "Should the resource overwrite the destination file contents if they already exist? If set to :auto the date stamp of files within the archive will be compared to those on disk and disk contents will be overwritten if they differ. This may cause unintended consequences if disk date stamps are changed between runs, which will result in the files being overwritten during each client run. Make sure to properly test any change to this property.", + default: false # backwards compatibility for the legacy cookbook names alias_method :extract_options, :options diff --git a/lib/chef/resource/build_essential.rb b/lib/chef/resource/build_essential.rb index de085f694b..e37b929fa5 100644 --- a/lib/chef/resource/build_essential.rb +++ b/lib/chef/resource/build_essential.rb @@ -29,8 +29,8 @@ class Chef property :name, String, default: "" property :compile_time, [TrueClass, FalseClass], - description: "Install the build essential packages at compile time.", - default: false, desired_state: false + description: "Install the build essential packages at compile time.", + default: false, desired_state: false action :install do diff --git a/lib/chef/resource/cab_package.rb b/lib/chef/resource/cab_package.rb index 1c1907801c..04d6f97976 100644 --- a/lib/chef/resource/cab_package.rb +++ b/lib/chef/resource/cab_package.rb @@ -32,14 +32,14 @@ class Chef allowed_actions :install, :remove - property :source, String, - description: "The local file path or URL for the CAB package.", - coerce: (proc do |s| - unless s.nil? - uri_scheme?(s) ? s : Chef::Util::PathHelper.canonical_path(s, false) - end - end), - default: lazy { |r| r.package_name }, default_description: "The package name." + property :source, String, + description: "The local file path or URL for the CAB package.", + coerce: (proc do |s| + unless s.nil? + uri_scheme?(s) ? s : Chef::Util::PathHelper.canonical_path(s, false) + end + end), + default: lazy { |r| r.package_name }, default_description: "The package name." end end end diff --git a/lib/chef/resource/chef_gem.rb b/lib/chef/resource/chef_gem.rb index 2410a316fd..755040f26b 100644 --- a/lib/chef/resource/chef_gem.rb +++ b/lib/chef/resource/chef_gem.rb @@ -43,8 +43,8 @@ class Chef "The chef_gem resource is restricted to the current gem environment, use gem_package to install to other environments." => proc { |v| v == "#{RbConfig::CONFIG['bindir']}/gem" }, } property :compile_time, [TrueClass, FalseClass], - description: "Controls the phase during which a gem is installed on a node. Set to 'true' to install a gem while the resource collection is being built (the 'compile phase'). Set to 'false' to install a gem while the #{Chef::Dist::CLIENT} is configuring the node (the 'converge phase').", - default: false, desired_state: false + description: "Controls the phase during which a gem is installed on a node. Set to 'true' to install a gem while the resource collection is being built (the 'compile phase'). Set to 'false' to install a gem while the #{Chef::Dist::CLIENT} is configuring the node (the 'converge phase').", + default: false, desired_state: false # force the resource to compile time if the compile time property has been set # diff --git a/lib/chef/resource/chef_handler.rb b/lib/chef/resource/chef_handler.rb index e6ff27c157..d5f4525744 100644 --- a/lib/chef/resource/chef_handler.rb +++ b/lib/chef/resource/chef_handler.rb @@ -28,19 +28,19 @@ class Chef introduced "14.0" property :class_name, String, - description: "The name of the handler class (can be module name-spaced).", - name_property: true + description: "The name of the handler class (can be module name-spaced).", + name_property: true property :source, String, - description: "The full path to the handler file. Can also be a gem path if the handler ships as part of a Ruby gem." + description: "The full path to the handler file. Can also be a gem path if the handler ships as part of a Ruby gem." property :arguments, [Array, Hash], - description: "Arguments to pass the handler's class initializer.", - default: lazy { [] } + description: "Arguments to pass the handler's class initializer.", + default: lazy { [] } property :type, Hash, - description: "The type of handler to register as, i.e. :report, :exception or both.", - default: { report: true, exception: true } + description: "The type of handler to register as, i.e. :report, :exception or both.", + default: { report: true, exception: true } # supports means a different thing in chef-land so we renamed it but # wanted to make sure we didn't break the world diff --git a/lib/chef/resource/chocolatey_config.rb b/lib/chef/resource/chocolatey_config.rb index 247fa5bf23..3a3814db3a 100644 --- a/lib/chef/resource/chocolatey_config.rb +++ b/lib/chef/resource/chocolatey_config.rb @@ -26,7 +26,7 @@ class Chef description: "An optional property to set the config key name if it differs from the resource block's name." property :value, String, - description: "The value to set." + description: "The value to set." load_current_value do current_val = fetch_config_element(config_key) diff --git a/lib/chef/resource/chocolatey_package.rb b/lib/chef/resource/chocolatey_package.rb index 04e5f3602c..76ef173ff5 100644 --- a/lib/chef/resource/chocolatey_package.rb +++ b/lib/chef/resource/chocolatey_package.rb @@ -31,20 +31,20 @@ class Chef # windows can't take Array options yet property :options, String, - description: "One (or more) additional options that are passed to the command." + description: "One (or more) additional options that are passed to the command." property :package_name, [String, Array], - description: "The name of the package. Default value: the name of the resource block.", - coerce: proc { |x| [x].flatten } + description: "The name of the package. Default value: the name of the resource block.", + coerce: proc { |x| [x].flatten } property :version, [String, Array], - description: "The version of a package to be installed or upgraded.", - coerce: proc { |x| [x].flatten } + description: "The version of a package to be installed or upgraded.", + coerce: proc { |x| [x].flatten } property :returns, [Integer, Array], - description: "The exit code(s) returned a chocolatey package that indicate success.", - default: [ 0 ], desired_state: false, - introduced: "12.18" + description: "The exit code(s) returned a chocolatey package that indicate success.", + default: [ 0 ], desired_state: false, + introduced: "12.18" end end end diff --git a/lib/chef/resource/chocolatey_source.rb b/lib/chef/resource/chocolatey_source.rb index 89c5d5a666..22ca387679 100644 --- a/lib/chef/resource/chocolatey_source.rb +++ b/lib/chef/resource/chocolatey_source.rb @@ -26,7 +26,7 @@ class Chef description: "An optional property to set the source name if it differs from the resource block's name." property :source, String, - description: "The source URL." + description: "The source URL." property :bypass_proxy, [TrueClass, FalseClass], default: false, description: "Whether or not to bypass the system's proxy settings to access the source." diff --git a/lib/chef/resource/cookbook_file.rb b/lib/chef/resource/cookbook_file.rb index 68f1e810df..cb1af567ab 100644 --- a/lib/chef/resource/cookbook_file.rb +++ b/lib/chef/resource/cookbook_file.rb @@ -33,12 +33,12 @@ class Chef 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::Dist::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\nDuring a #{Chef::Dist::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 ], - description: "The name of the file in COOKBOOK_NAME/files/default or the path to a file located in COOKBOOK_NAME/files. The path must include the file name and its extension. This can be used to distribute specific files depending upon the platform used.", - default: lazy { ::File.basename(name) } + description: "The name of the file in COOKBOOK_NAME/files/default or the path to a file located in COOKBOOK_NAME/files. The path must include the file name and its extension. This can be used to distribute specific files depending upon the platform used.", + default: lazy { ::File.basename(name) } property :cookbook, String, - description: "The cookbook in which a file is located (if it is not located in the current cookbook).", - desired_state: false + description: "The cookbook in which a file is located (if it is not located in the current cookbook).", + desired_state: false default_action :create end diff --git a/lib/chef/resource/cron.rb b/lib/chef/resource/cron.rb index d942b10183..ad8e228152 100644 --- a/lib/chef/resource/cron.rb +++ b/lib/chef/resource/cron.rb @@ -135,32 +135,32 @@ class Chef end property :time, Symbol, - description: "A time interval. Possible values: :annually, :daily, :hourly, :midnight, :monthly, :reboot, :weekly, or :yearly.", - equal_to: Chef::Provider::Cron::SPECIAL_TIME_VALUES + description: "A time interval. Possible values: :annually, :daily, :hourly, :midnight, :monthly, :reboot, :weekly, or :yearly.", + equal_to: Chef::Provider::Cron::SPECIAL_TIME_VALUES property :mailto, String, - description: "Set the MAILTO environment variable." + description: "Set the MAILTO environment variable." property :path, String, - description: "Set the PATH environment variable." + description: "Set the PATH environment variable." property :home, String, - description: "Set the HOME environment variable." + description: "Set the HOME environment variable." property :shell, String, - description: "Set the SHELL environment variable." + description: "Set the SHELL environment variable." property :command, String, - description: "The command to be run, or the path to a file that contains the command to be run.", - identity: true + description: "The command to be run, or the path to a file that contains the command to be run.", + identity: true property :user, String, - description: "The name of the user that runs the command. If the user property is changed, the original user for the crontab program continues to run until that crontab program is deleted. This property is not applicable on the AIX platform.", - default: "root" + description: "The name of the user that runs the command. If the user property is changed, the original user for the crontab program continues to run until that crontab program is deleted. This property is not applicable on the AIX platform.", + default: "root" property :environment, Hash, - description: "A Hash of environment variables in the form of ({'ENV_VARIABLE' => 'VALUE'}).", - default: lazy { Hash.new } + description: "A Hash of environment variables in the form of ({'ENV_VARIABLE' => 'VALUE'}).", + default: lazy { Hash.new } private diff --git a/lib/chef/resource/cron_access.rb b/lib/chef/resource/cron_access.rb index 54b06c4233..6c0272b667 100644 --- a/lib/chef/resource/cron_access.rb +++ b/lib/chef/resource/cron_access.rb @@ -30,8 +30,8 @@ class Chef description "Use the cron_access resource to manage the /etc/cron.allow and /etc/cron.deny files." property :user, String, - description: "An optional property to set the user name if it differs from the resource block's name.", - name_property: true + description: "An optional property to set the user name if it differs from the resource block's name.", + name_property: true action :allow do description "Add the user to the cron.allow file." diff --git a/lib/chef/resource/cron_d.rb b/lib/chef/resource/cron_d.rb index 8dfa810ad9..6fcca2a231 100644 --- a/lib/chef/resource/cron_d.rb +++ b/lib/chef/resource/cron_d.rb @@ -88,78 +88,78 @@ class Chef end property :cron_name, String, - description: "An optional property to set the cron name if it differs from the resource block's name.", - name_property: true + description: "An optional property to set the cron name if it differs from the resource block's name.", + name_property: true property :cookbook, String, desired_state: false property :predefined_value, String, - description: 'Schedule your cron job with one of the special predefined value instead of ** * pattern. This correspond to "@reboot", "@yearly", "@annually", "@monthly", "@weekly", "@daily", "@midnight" or "@hourly".', - equal_to: %w{ @reboot @yearly @annually @monthly @weekly @daily @midnight @hourly } + description: 'Schedule your cron job with one of the special predefined value instead of ** * pattern. This correspond to "@reboot", "@yearly", "@annually", "@monthly", "@weekly", "@daily", "@midnight" or "@hourly".', + equal_to: %w{ @reboot @yearly @annually @monthly @weekly @daily @midnight @hourly } property :minute, [Integer, String], - description: "The minute at which the cron entry should run (0 - 59).", - default: "*", callbacks: { - "should be a valid minute spec" => ->(spec) { validate_numeric(spec, 0, 59) }, - } + description: "The minute at which the cron entry should run (0 - 59).", + default: "*", callbacks: { + "should be a valid minute spec" => ->(spec) { validate_numeric(spec, 0, 59) }, + } property :hour, [Integer, String], - description: "The hour at which the cron entry should run (0 - 23).", - default: "*", callbacks: { - "should be a valid hour spec" => ->(spec) { validate_numeric(spec, 0, 23) }, - } + description: "The hour at which the cron entry should run (0 - 23).", + default: "*", callbacks: { + "should be a valid hour spec" => ->(spec) { validate_numeric(spec, 0, 23) }, + } property :day, [Integer, String], - description: "The day of month at which the cron entry should run (1 - 31).", - default: "*", callbacks: { - "should be a valid day spec" => ->(spec) { validate_numeric(spec, 1, 31) }, - } + description: "The day of month at which the cron entry should run (1 - 31).", + default: "*", callbacks: { + "should be a valid day spec" => ->(spec) { validate_numeric(spec, 1, 31) }, + } property :month, [Integer, String], - description: "The month in the year on which a cron entry is to run (1 - 12, jan-dec, or *).", - default: "*", callbacks: { - "should be a valid month spec" => ->(spec) { validate_month(spec) }, - } + description: "The month in the year on which a cron entry is to run (1 - 12, jan-dec, or *).", + default: "*", callbacks: { + "should be a valid month spec" => ->(spec) { validate_month(spec) }, + } property :weekday, [Integer, String], - description: "The day of the week on which this entry is to run (0-7, mon-sun, or *), where Sunday is both 0 and 7.", - default: "*", callbacks: { - "should be a valid weekday spec" => ->(spec) { validate_dow(spec) }, - } + description: "The day of the week on which this entry is to run (0-7, mon-sun, or *), where Sunday is both 0 and 7.", + default: "*", callbacks: { + "should be a valid weekday spec" => ->(spec) { validate_dow(spec) }, + } property :command, String, - description: "The command to run.", - required: true + description: "The command to run.", + required: true property :user, String, - description: "The name of the user that runs the command.", - default: "root" + description: "The name of the user that runs the command.", + default: "root" property :mailto, String, - description: "Set the MAILTO environment variable in the cron.d file." + description: "Set the MAILTO environment variable in the cron.d file." property :path, String, - description: "Set the PATH environment variable in the cron.d file." + description: "Set the PATH environment variable in the cron.d file." property :home, String, - description: "Set the HOME environment variable in the cron.d file." + description: "Set the HOME environment variable in the cron.d file." property :shell, String, - description: "Set the SHELL environment variable in the cron.d file." + description: "Set the SHELL environment variable in the cron.d file." property :comment, String, - description: "A comment to place in the cron.d file." + description: "A comment to place in the cron.d file." property :environment, Hash, - description: "A Hash containing additional arbitrary environment variables under which the cron job will be run in the form of ``({'ENV_VARIABLE' => 'VALUE'})``.", - default: lazy { Hash.new } + description: "A Hash containing additional arbitrary environment variables under which the cron job will be run in the form of ``({'ENV_VARIABLE' => 'VALUE'})``.", + default: lazy { Hash.new } property :mode, [String, Integer], - description: "The octal mode of the generated crontab file.", - default: "0600" + description: "The octal mode of the generated crontab file.", + default: "0600" property :random_delay, Integer, - description: "Set the RANDOM_DELAY environment variable in the cron.d file." + description: "Set the RANDOM_DELAY environment variable in the cron.d file." # warn if someone passes the deprecated cookbook property def after_created diff --git a/lib/chef/resource/directory.rb b/lib/chef/resource/directory.rb index 0870598795..9443c893d1 100644 --- a/lib/chef/resource/directory.rb +++ b/lib/chef/resource/directory.rb @@ -44,8 +44,8 @@ class Chef description: "The path to the directory. Using a fully qualified path is recommended, but is not always required." property :recursive, [ TrueClass, FalseClass ], - description: "Create or delete parent directories recursively. For the owner, group, and mode properties, the value of this property applies only to the leaf directory.", - default: false + description: "Create or delete parent directories recursively. For the owner, group, and mode properties, the value of this property applies only to the leaf directory.", + default: false end end end diff --git a/lib/chef/resource/dmg_package.rb b/lib/chef/resource/dmg_package.rb index 660c6a332e..dfe6eb45c6 100644 --- a/lib/chef/resource/dmg_package.rb +++ b/lib/chef/resource/dmg_package.rb @@ -27,57 +27,57 @@ class Chef introduced "14.0" property :app, String, - description: "The name of the application as it appears in the /Volumes directory if it differs from the resource block's name.", - name_property: true + description: "The name of the application as it appears in the /Volumes directory if it differs from the resource block's name.", + name_property: true property :source, String, - description: "The remote URL that is used to download the .dmg file, if specified." + description: "The remote URL that is used to download the .dmg file, if specified." property :file, String, - description: "The full path to the .dmg file on the local system." + description: "The full path to the .dmg file on the local system." property :owner, [String, Integer], - description: "The user that should own the package installation." + description: "The user that should own the package installation." property :destination, String, - description: "The directory to copy the .app into.", - default: "/Applications" + description: "The directory to copy the .app into.", + default: "/Applications" property :checksum, String, - description: "The sha256 checksum of the .dmg file to download." + description: "The sha256 checksum of the .dmg file to download." property :volumes_dir, String, - description: "The directory under /Volumes where the dmg is mounted if it differs from the name of the .dmg file.", - default: lazy { |r| r.app }, default_description: "The value passed for the application name." + description: "The directory under /Volumes where the dmg is mounted if it differs from the name of the .dmg file.", + default: lazy { |r| r.app }, default_description: "The value passed for the application name." property :dmg_name, String, - description: "The name of the .dmg file if it differs from that of the app, or if the name has spaces.", - desired_state: false, - default: lazy { |r| r.app }, default_description: "The value passed for the application name." + description: "The name of the .dmg file if it differs from that of the app, or if the name has spaces.", + desired_state: false, + default: lazy { |r| r.app }, default_description: "The value passed for the application name." property :type, String, - description: "The type of package.", - equal_to: %w{app pkg mpkg}, - default: "app", desired_state: false + description: "The type of package.", + equal_to: %w{app pkg mpkg}, + default: "app", desired_state: false property :package_id, String, - description: "The package ID that is registered with pkgutil when a pkg or mpkg is installed." + description: "The package ID that is registered with pkgutil when a pkg or mpkg is installed." property :dmg_passphrase, String, - description: "Specify a passphrase to be used to decrypt the .dmg file during the mount process.", - desired_state: false + description: "Specify a passphrase to be used to decrypt the .dmg file during the mount process.", + desired_state: false property :accept_eula, [TrueClass, FalseClass], - description: "Specify whether to accept the EULA. Certain dmgs require acceptance of EULA before mounting.", - default: false, desired_state: false + description: "Specify whether to accept the EULA. Certain dmgs require acceptance of EULA before mounting.", + default: false, desired_state: false property :headers, Hash, - description: "Allows custom HTTP headers (like cookies) to be set on the remote_file resource.", - desired_state: false + description: "Allows custom HTTP headers (like cookies) to be set on the remote_file resource.", + desired_state: false property :allow_untrusted, [TrueClass, FalseClass], - description: "Allow installation of packages that do not have trusted certificates.", - default: false, desired_state: false + description: "Allow installation of packages that do not have trusted certificates.", + default: false, desired_state: false load_current_value do |new_resource| if ::File.directory?("#{new_resource.destination}/#{new_resource.app}.app") diff --git a/lib/chef/resource/dnf_package.rb b/lib/chef/resource/dnf_package.rb index 616d79a337..a89f6bfcff 100644 --- a/lib/chef/resource/dnf_package.rb +++ b/lib/chef/resource/dnf_package.rb @@ -48,26 +48,26 @@ class Chef # Install a specific arch property :arch, [String, Array], - description: "The architecture of the package to be installed or upgraded. This value can also be passed as part of the package name.", - coerce: proc { |x| [x].flatten } + description: "The architecture of the package to be installed or upgraded. This value can also be passed as part of the package name.", + coerce: proc { |x| [x].flatten } # Flush the in-memory available/installed cache, this does not flush the dnf caches on disk property :flush_cache, Hash, - description: "Flush the in-memory cache before or after a DNF operation that installs, upgrades, or removes a package. DNF automatically synchronizes remote metadata to a local cache. The #{Chef::Dist::CLIENT} creates a copy of the local cache, and then stores it in-memory during the #{Chef::Dist::CLIENT} run. The in-memory cache allows packages to be installed during the #{Chef::Dist::CLIENT} run without the need to continue synchronizing the remote metadata to the local cache while the #{Chef::Dist::CLIENT} run is in-progress.", - default: { before: false, after: false }, - coerce: proc { |v| - if v.is_a?(Hash) - v - elsif v.is_a?(Array) - v.each_with_object({}) { |arg, obj| obj[arg] = true } - elsif v.is_a?(TrueClass) || v.is_a?(FalseClass) - { before: v, after: v } - elsif v == :before - { before: true, after: false } - elsif v == :after - { after: true, before: false } - end - } + description: "Flush the in-memory cache before or after a DNF operation that installs, upgrades, or removes a package. DNF automatically synchronizes remote metadata to a local cache. The #{Chef::Dist::CLIENT} creates a copy of the local cache, and then stores it in-memory during the #{Chef::Dist::CLIENT} run. The in-memory cache allows packages to be installed during the #{Chef::Dist::CLIENT} run without the need to continue synchronizing the remote metadata to the local cache while the #{Chef::Dist::CLIENT} run is in-progress.", + default: { before: false, after: false }, + coerce: proc { |v| + if v.is_a?(Hash) + v + elsif v.is_a?(Array) + v.each_with_object({}) { |arg, obj| obj[arg] = true } + elsif v.is_a?(TrueClass) || v.is_a?(FalseClass) + { before: v, after: v } + elsif v == :before + { before: true, after: false } + elsif v == :after + { after: true, before: false } + end + } def allow_downgrade(arg = nil) if !arg.nil? diff --git a/lib/chef/resource/dpkg_package.rb b/lib/chef/resource/dpkg_package.rb index 2072ad8cfc..9e49dded46 100644 --- a/lib/chef/resource/dpkg_package.rb +++ b/lib/chef/resource/dpkg_package.rb @@ -27,15 +27,15 @@ class Chef 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 ], - description: "The path to a package in the local file system." + description: "The path to a package in the local file system." property :response_file, String, - description: "The direct path to the file used to pre-seed a package.", - desired_state: false + description: "The direct path to the file used to pre-seed a package.", + desired_state: false property :response_file_variables, Hash, - description: "A Hash of response file variables in the form of {'VARIABLE' => 'VALUE'}.", - default: lazy { Hash.new }, desired_state: false + description: "A Hash of response file variables in the form of {'VARIABLE' => 'VALUE'}.", + default: lazy { Hash.new }, desired_state: false end end end diff --git a/lib/chef/resource/dsc_resource.rb b/lib/chef/resource/dsc_resource.rb index 79ed42c60e..8d03231367 100644 --- a/lib/chef/resource/dsc_resource.rb +++ b/lib/chef/resource/dsc_resource.rb @@ -73,8 +73,8 @@ class Chef end property :module_version, String, - introduced: "12.21", - description: "The version number of the module to use. PowerShell 5.0.10018.0 (or higher) supports having multiple versions of a module installed. This should be specified along with the module_name." + introduced: "12.21", + description: "The version number of the module to use. PowerShell 5.0.10018.0 (or higher) supports having multiple versions of a module installed. This should be specified along with the module_name." def property(property_name, value = nil) if not property_name.is_a?(Symbol) @@ -104,8 +104,8 @@ class Chef description: "Use to request an immediate reboot or to queue a reboot using the :reboot_now (immediate reboot) or :request_reboot (queued reboot) actions built into the reboot resource." property :timeout, Integer, - introduced: "12.6", - description: "The amount of time (in seconds) a command is to wait before timing out." + introduced: "12.6", + description: "The amount of time (in seconds) a command is to wait before timing out." private diff --git a/lib/chef/resource/dsc_script.rb b/lib/chef/resource/dsc_script.rb index 684cbc4e0c..83f355c9c4 100644 --- a/lib/chef/resource/dsc_script.rb +++ b/lib/chef/resource/dsc_script.rb @@ -110,16 +110,16 @@ class Chef end property :flags, Hash, - description: "Pass parameters to the DSC script that is specified by the command property. Parameters are defined as key-value pairs, where the value of each key is the parameter to pass. This property may not be used in the same recipe as the code property." + description: "Pass parameters to the DSC script that is specified by the command property. Parameters are defined as key-value pairs, where the value of each key is the parameter to pass. This property may not be used in the same recipe as the code property." property :cwd, String, - description: "The current working directory." + description: "The current working directory." property :environment, Hash, - description: "A Hash of environment variables in the form of ({'ENV_VARIABLE' => 'VALUE'}). (These variables must exist for a command to be run successfully)." + description: "A Hash of environment variables in the form of ({'ENV_VARIABLE' => 'VALUE'}). (These variables must exist for a command to be run successfully)." property :timeout, Integer, - description: "The amount of time (in seconds) a command is to wait before timing out." + description: "The amount of time (in seconds) a command is to wait before timing out." end end end diff --git a/lib/chef/resource/execute.rb b/lib/chef/resource/execute.rb index d61ed20662..50fa0f13b2 100644 --- a/lib/chef/resource/execute.rb +++ b/lib/chef/resource/execute.rb @@ -48,23 +48,23 @@ class Chef end property :command, [ String, Array ], - name_property: true, identity: true, - description: "An optional property to set the command to be executed if it differs from the resource block's name." + name_property: true, identity: true, + description: "An optional property to set the command to be executed if it differs from the resource block's name." property :umask, [ String, Integer ], - description: "The file mode creation mask, or umask." + description: "The file mode creation mask, or umask." property :creates, String, - description: "Prevent a command from creating a file when that file already exists." + description: "Prevent a command from creating a file when that file already exists." property :cwd, String, - description: "The current working directory from which the command will be run." + description: "The current working directory from which the command will be run." property :environment, Hash, - description: "A Hash of environment variables in the form of ({'ENV_VARIABLE' => 'VALUE'})." + description: "A Hash of environment variables in the form of ({'ENV_VARIABLE' => 'VALUE'})." property :group, [ String, Integer ], - description: "The group name or group ID that must be changed before running a command." + description: "The group name or group ID that must be changed before running a command." property :live_stream, [ TrueClass, FalseClass ], default: false, description: "Send the output of the command run by this execute resource block to the #{Chef::Dist::CLIENT} event stream." @@ -78,14 +78,14 @@ class Chef description: "The return value for a command. This may be an array of accepted values. An exception is raised when the return value(s) do not match." property :timeout, [ Integer, Float ], - description: "The amount of time (in seconds) a command is to wait before timing out." + description: "The amount of time (in seconds) a command is to wait before timing out." property :user, [ String, Integer ], - description: "The user name of the user identity with which to launch the new process. The user name may optionally be specifed with a domain, i.e. domainuser or user@my.dns.domain.com via Universal Principal Name (UPN)format. It can also be specified without a domain simply as user if the domain is instead specified using the domain property. On Windows only, if this property is specified, the password property must be specified." + description: "The user name of the user identity with which to launch the new process. The user name may optionally be specifed with a domain, i.e. domainuser or user@my.dns.domain.com via Universal Principal Name (UPN)format. It can also be specified without a domain simply as user if the domain is instead specified using the domain property. On Windows only, if this property is specified, the password property must be specified." property :domain, String, - introduced: "12.21", - description: "Windows only: The domain of the user user specified by the user property. If not specified, the user name and password specified by the user and password properties will be used to resolve that user against the domain in which the system running #{Chef::Dist::PRODUCT} is joined, or if that system is not joined to a domain it will resolve the user as a local account on that system. An alternative way to specify the domain is to leave this property unspecified and specify the domain as part of the user property." + introduced: "12.21", + description: "Windows only: The domain of the user user specified by the user property. If not specified, the user name and password specified by the user and password properties will be used to resolve that user against the domain in which the system running #{Chef::Dist::PRODUCT} is joined, or if that system is not joined to a domain it will resolve the user as a local account on that system. An alternative way to specify the domain is to leave this property unspecified and specify the domain as part of the user property." property :password, String, sensitive: true, introduced: "12.21", @@ -93,8 +93,8 @@ class Chef # lazy used to set default value of sensitive to true if password is set property :sensitive, [ TrueClass, FalseClass ], - description: "Ensure that sensitive resource data is not logged by the #{Chef::Dist::CLIENT}.", - default: lazy { |r| r.password ? true : false }, default_description: "True if the password property is set. False otherwise." + description: "Ensure that sensitive resource data is not logged by the #{Chef::Dist::CLIENT}.", + default: lazy { |r| r.password ? true : false }, default_description: "True if the password property is set. False otherwise." property :elevated, [ TrueClass, FalseClass ], default: false, description: "Determines whether the script will run with elevated permissions to circumvent User Access Control (UAC) interactively blocking the process.\nThis will cause the process to be run under a batch login instead of an interactive login. The user running #{Chef::Dist::CLIENT} needs the “Replace a process level token” and “Adjust Memory Quotas for a process” permissions. The user that is running the command needs the “Log on as a batch job” permission.\nBecause this requires a login, the user and password properties are required.", diff --git a/lib/chef/resource/file.rb b/lib/chef/resource/file.rb index 0bfd57ea7f..47fd9cada7 100644 --- a/lib/chef/resource/file.rb +++ b/lib/chef/resource/file.rb @@ -62,7 +62,7 @@ class Chef description: "The number of backups to be kept in /var/chef/backup (for UNIX- and Linux-based platforms) or C:/chef/backup (for the Microsoft Windows platform). Set to false to prevent backups from being kept." property :checksum, [ /^[a-zA-Z0-9]{64}$/, nil ], - description: "The SHA-256 checksum of the file. Use to ensure that a specific file is used. If the checksum does not match, the file is not used." + description: "The SHA-256 checksum of the file. Use to ensure that a specific file is used. If the checksum does not match, the file is not used." property :content, [ String, nil ], desired_state: false, description: "A string that is written to the file. The contents of this property replace any previous content when this property has something other than the default value. The default behavior will not modify content." diff --git a/lib/chef/resource/gem_package.rb b/lib/chef/resource/gem_package.rb index e736920811..30e9edf0b4 100644 --- a/lib/chef/resource/gem_package.rb +++ b/lib/chef/resource/gem_package.rb @@ -38,22 +38,22 @@ class Chef # FIXME? the array form of installing paths most likely does not work? # property :source, [ String, Array ], - description: "Optional. The URL, or list of URLs, at which the gem package is located. This list is added to the source configured in Chef::Config[:rubygems_url] (see also include_default_source) to construct the complete list of rubygems sources. Users in an 'airgapped' environment should set Chef::Config[:rubygems_url] to their local RubyGems mirror." + description: "Optional. The URL, or list of URLs, at which the gem package is located. This list is added to the source configured in Chef::Config[:rubygems_url] (see also include_default_source) to construct the complete list of rubygems sources. Users in an 'airgapped' environment should set Chef::Config[:rubygems_url] to their local RubyGems mirror." property :clear_sources, [ TrueClass, FalseClass ], - description: "Set to 'true' to download a gem from the path specified by the source property (and not from RubyGems).", - default: lazy { Chef::Config[:clear_gem_sources] }, desired_state: false + description: "Set to 'true' to download a gem from the path specified by the source property (and not from RubyGems).", + default: lazy { Chef::Config[:clear_gem_sources] }, desired_state: false property :gem_binary, String, desired_state: false, description: "The path of a gem binary to use for the installation. By default, the same version of Ruby that is used by the #{Chef::Dist::CLIENT} will be installed." property :include_default_source, [ TrueClass, FalseClass ], - description: "Set to 'false' to not include 'Chef::Config[:rubygems_url]'' in the sources.", - default: true, introduced: "13.0" + description: "Set to 'false' to not include 'Chef::Config[:rubygems_url]'' in the sources.", + default: true, introduced: "13.0" property :options, [ String, Hash, Array, nil ], - description: "Options for the gem install, either a Hash or a String. When a hash is given, the options are passed to Gem::DependencyInstaller.new, and the gem will be installed via the gems API. When a String is given, the gem will be installed by shelling out to the gem command. Using a Hash of options with an explicit gem_binary will result in undefined behavior.", - desired_state: false + description: "Options for the gem install, either a Hash or a String. When a hash is given, the options are passed to Gem::DependencyInstaller.new, and the gem will be installed via the gems API. When a String is given, the gem will be installed by shelling out to the gem command. Using a Hash of options with an explicit gem_binary will result in undefined behavior.", + desired_state: false end end end diff --git a/lib/chef/resource/git.rb b/lib/chef/resource/git.rb index 95c5aa346a..dfb2921f97 100644 --- a/lib/chef/resource/git.rb +++ b/lib/chef/resource/git.rb @@ -24,8 +24,8 @@ class Chef 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." property :additional_remotes, Hash, - description: "A Hash of additional remotes that are added to the git repository configuration.", - default: lazy { Hash.new } + description: "A Hash of additional remotes that are added to the git repository configuration.", + default: lazy { Hash.new } alias :branch :revision alias :reference :revision diff --git a/lib/chef/resource/group.rb b/lib/chef/resource/group.rb index 7aaecc1374..c5dd83efc2 100644 --- a/lib/chef/resource/group.rb +++ b/lib/chef/resource/group.rb @@ -28,11 +28,11 @@ class Chef default_action :create property :group_name, String, - name_property: true, identity: true, - description: "The name of the group." + name_property: true, identity: true, + description: "The name of the group." property :gid, [ String, Integer ], - description: "The identifier for the group." + description: "The identifier for the group." property :members, [String, Array], default: lazy { [] }, coerce: proc { |arg| arg.is_a?(String) ? arg.split(/\s*,\s*/) : arg }, @@ -52,8 +52,8 @@ class Chef description: "Allow gid duplication. May only be used with the Groupadd provider." property :comment, String, - introduced: "14.9", - description: "Specifies a comment to associate with the local group." + introduced: "14.9", + description: "Specifies a comment to associate with the local group." alias_method :users, :members end diff --git a/lib/chef/resource/homebrew_cask.rb b/lib/chef/resource/homebrew_cask.rb index 6d9d9867d8..70e1d7c6bb 100644 --- a/lib/chef/resource/homebrew_cask.rb +++ b/lib/chef/resource/homebrew_cask.rb @@ -32,25 +32,25 @@ class Chef include Chef::Mixin::HomebrewUser property :cask_name, String, - description: "An optional property to set the cask name if it differs from the resource block's name.", - regex: %r{^[\w/-]+$}, - validation_message: "The provided Homebrew cask name is not valid. Cask names can contain alphanumeric characters, _, -, or / only!", - name_property: true + description: "An optional property to set the cask name if it differs from the resource block's name.", + regex: %r{^[\w/-]+$}, + validation_message: "The provided Homebrew cask name is not valid. Cask names can contain alphanumeric characters, _, -, or / only!", + name_property: true property :options, String, - description: "Options to pass to the brew command during installation." + description: "Options to pass to the brew command during installation." property :install_cask, [TrueClass, FalseClass], - description: "Automatically install the Homebrew cask tap, if necessary.", - default: true + description: "Automatically install the Homebrew cask tap, if necessary.", + default: true property :homebrew_path, String, - description: "The path to the homebrew binary.", - default: "/usr/local/bin/brew" + description: "The path to the homebrew binary.", + default: "/usr/local/bin/brew" property :owner, [String, Integer], - description: "The owner of the Homebrew installation.", - default: lazy { find_homebrew_username } + description: "The owner of the Homebrew installation.", + default: lazy { find_homebrew_username } action :install do description "Install an application packaged as a Homebrew cask." @@ -60,9 +60,9 @@ class Chef unless casked? converge_by("install cask #{new_resource.cask_name} #{new_resource.options}") do shell_out!("#{new_resource.homebrew_path} cask install #{new_resource.cask_name} #{new_resource.options}", - user: new_resource.owner, - env: { "HOME" => ::Dir.home(new_resource.owner), "USER" => new_resource.owner }, - cwd: ::Dir.home(new_resource.owner)) + user: new_resource.owner, + env: { "HOME" => ::Dir.home(new_resource.owner), "USER" => new_resource.owner }, + cwd: ::Dir.home(new_resource.owner)) end end end @@ -75,9 +75,9 @@ class Chef if casked? converge_by("uninstall cask #{new_resource.cask_name}") do shell_out!("#{new_resource.homebrew_path} cask uninstall #{new_resource.cask_name}", - user: new_resource.owner, - env: { "HOME" => ::Dir.home(new_resource.owner), "USER" => new_resource.owner }, - cwd: ::Dir.home(new_resource.owner)) + user: new_resource.owner, + env: { "HOME" => ::Dir.home(new_resource.owner), "USER" => new_resource.owner }, + cwd: ::Dir.home(new_resource.owner)) end end end diff --git a/lib/chef/resource/homebrew_package.rb b/lib/chef/resource/homebrew_package.rb index 50bbfb0847..a9c98430d4 100644 --- a/lib/chef/resource/homebrew_package.rb +++ b/lib/chef/resource/homebrew_package.rb @@ -32,7 +32,7 @@ class Chef introduced "12.0" property :homebrew_user, [ String, Integer ], - description: "The name of the Homebrew owner to be used by the #{Chef::Dist::CLIENT} when executing a command." + description: "The name of the Homebrew owner to be used by the #{Chef::Dist::CLIENT} when executing a command." end end diff --git a/lib/chef/resource/homebrew_tap.rb b/lib/chef/resource/homebrew_tap.rb index 6e6d9c823f..8f415a3ff1 100644 --- a/lib/chef/resource/homebrew_tap.rb +++ b/lib/chef/resource/homebrew_tap.rb @@ -32,25 +32,25 @@ class Chef include Chef::Mixin::HomebrewUser property :tap_name, String, - description: "An optional property to set the tap name if it differs from the resource block's name.", - validation_message: "Homebrew tap names must be in the form REPO/TAP format!", - regex: %r{^[\w-]+(?:\/[\w-]+)+$}, - name_property: true + description: "An optional property to set the tap name if it differs from the resource block's name.", + validation_message: "Homebrew tap names must be in the form REPO/TAP format!", + regex: %r{^[\w-]+(?:\/[\w-]+)+$}, + name_property: true property :url, String, - description: "The URL of the tap." + description: "The URL of the tap." property :full, [TrueClass, FalseClass], - description: "Perform a full clone on the tap, as opposed to a shallow clone.", - default: false + description: "Perform a full clone on the tap, as opposed to a shallow clone.", + default: false property :homebrew_path, String, - description: "The path to the Homebrew binary.", - default: "/usr/local/bin/brew" + description: "The path to the Homebrew binary.", + default: "/usr/local/bin/brew" property :owner, String, - description: "The owner of the Homebrew installation.", - default: lazy { find_homebrew_username } + description: "The owner of the Homebrew installation.", + default: lazy { find_homebrew_username } action :tap do description "Add a Homebrew tap." @@ -58,9 +58,9 @@ class Chef unless tapped?(new_resource.tap_name) converge_by("tap #{new_resource.tap_name}") do shell_out!("#{new_resource.homebrew_path} tap #{new_resource.full ? '--full' : ''} #{new_resource.tap_name} #{new_resource.url || ''}", - user: new_resource.owner, - env: { "HOME" => ::Dir.home(new_resource.owner), "USER" => new_resource.owner }, - cwd: ::Dir.home(new_resource.owner)) + user: new_resource.owner, + env: { "HOME" => ::Dir.home(new_resource.owner), "USER" => new_resource.owner }, + cwd: ::Dir.home(new_resource.owner)) end end end @@ -71,9 +71,9 @@ class Chef if tapped?(new_resource.tap_name) converge_by("untap #{new_resource.tap_name}") do shell_out!("#{new_resource.homebrew_path} untap #{new_resource.tap_name}", - user: new_resource.owner, - env: { "HOME" => ::Dir.home(new_resource.owner), "USER" => new_resource.owner }, - cwd: ::Dir.home(new_resource.owner)) + user: new_resource.owner, + env: { "HOME" => ::Dir.home(new_resource.owner), "USER" => new_resource.owner }, + cwd: ::Dir.home(new_resource.owner)) end end end diff --git a/lib/chef/resource/hostname.rb b/lib/chef/resource/hostname.rb index f22eda809e..71160e983e 100644 --- a/lib/chef/resource/hostname.rb +++ b/lib/chef/resource/hostname.rb @@ -27,24 +27,24 @@ class Chef introduced "14.0" property :hostname, String, - description: "An optional property to set the hostname if it differs from the resource block's name.", - name_property: true + description: "An optional property to set the hostname if it differs from the resource block's name.", + name_property: true property :compile_time, [ TrueClass, FalseClass ], - description: "Determines whether or not the resource should be run at compile time.", - default: true, desired_state: false + description: "Determines whether or not the resource should be run at compile time.", + default: true, desired_state: false property :ipaddress, String, - description: "The IP address to use when configuring the hosts file.", - default: lazy { node["ipaddress"] }, default_description: "The node's IP address as determined by Ohai." + description: "The IP address to use when configuring the hosts file.", + default: lazy { node["ipaddress"] }, default_description: "The node's IP address as determined by Ohai." property :aliases, [ Array, nil ], - description: "An array of hostname aliases to use when configuring the hosts file.", - default: nil + description: "An array of hostname aliases to use when configuring the hosts file.", + default: nil property :windows_reboot, [ TrueClass, FalseClass ], - description: "Determines whether or not Windows should be reboot after changing the hostname, as this is required for the change to take effect.", - default: true + description: "Determines whether or not Windows should be reboot after changing the hostname, as this is required for the change to take effect.", + default: true action_class do def append_replacing_matching_lines(path, regex, string) diff --git a/lib/chef/resource/ifconfig.rb b/lib/chef/resource/ifconfig.rb index 5efc7b0150..3b420b843d 100644 --- a/lib/chef/resource/ifconfig.rb +++ b/lib/chef/resource/ifconfig.rb @@ -36,70 +36,70 @@ class Chef allowed_actions :add, :delete, :enable, :disable property :target, String, - name_property: true, - description: "The IP address that is to be assigned to the network interface. If not specified we'll use the resource's name." + name_property: true, + description: "The IP address that is to be assigned to the network interface. If not specified we'll use the resource's name." property :hwaddr, String, - description: "The hardware address for the network interface." + description: "The hardware address for the network interface." property :mask, String, - description: "The decimal representation of the network mask. For example: 255.255.255.0." + description: "The decimal representation of the network mask. For example: 255.255.255.0." property :family, String, default: "inet", introduced: "14.0", description: "Networking family option for Debian-based systems. For example: inet or inet6." property :inet_addr, String, - description: "The Internet host address for the network interface." + description: "The Internet host address for the network interface." property :bcast, String, - description: "The broadcast address for a network interface. On some platforms this property is not set using ifconfig, but instead is added to the startup configuration file for the network interface." + description: "The broadcast address for a network interface. On some platforms this property is not set using ifconfig, but instead is added to the startup configuration file for the network interface." property :mtu, String, - description: "The maximum transmission unit (MTU) for the network interface." + description: "The maximum transmission unit (MTU) for the network interface." property :metric, String, - description: "The routing metric for the interface." + description: "The routing metric for the interface." property :device, String, - identity: true, - description: "The network interface to be configured." + identity: true, + description: "The network interface to be configured." property :onboot, String, - description: "Bring up the network interface on boot." + description: "Bring up the network interface on boot." property :network, String, - description: "The address for the network interface." + description: "The address for the network interface." property :bootproto, String, - description: "The boot protocol used by a network interface." + description: "The boot protocol used by a network interface." property :onparent, String, - description: "Bring up the network interface when its parent interface is brought up." + description: "Bring up the network interface when its parent interface is brought up." property :ethtool_opts, String, - introduced: "13.4", - description: "Options to be passed to ethtool(8). For example: -A eth0 autoneg off rx off tx off." + introduced: "13.4", + description: "Options to be passed to ethtool(8). For example: -A eth0 autoneg off rx off tx off." property :bonding_opts, String, - introduced: "13.4", - description: "Bonding options to pass via BONDING_OPTS on RHEL and CentOS. For example: mode=active-backup miimon=100." + introduced: "13.4", + description: "Bonding options to pass via BONDING_OPTS on RHEL and CentOS. For example: mode=active-backup miimon=100." property :master, String, - introduced: "13.4", - description: "Specifies the channel bonding interface to which the Ethernet interface is linked." + introduced: "13.4", + description: "Specifies the channel bonding interface to which the Ethernet interface is linked." property :slave, String, - introduced: "13.4", - description: "When set to yes, this device is controlled by the channel bonding interface that is specified via the master property." + introduced: "13.4", + description: "When set to yes, this device is controlled by the channel bonding interface that is specified via the master property." property :vlan, String, - introduced: "14.4", - description: "The VLAN to assign the interface to." + introduced: "14.4", + description: "The VLAN to assign the interface to." property :gateway, String, - introduced: "14.4", - description: "The gateway to use for the interface." + introduced: "14.4", + description: "The gateway to use for the interface." end end end diff --git a/lib/chef/resource/ips_package.rb b/lib/chef/resource/ips_package.rb index 495cb2bc5a..66cee48aee 100644 --- a/lib/chef/resource/ips_package.rb +++ b/lib/chef/resource/ips_package.rb @@ -31,8 +31,8 @@ class Chef allowed_actions :install, :remove, :upgrade property :accept_license, [TrueClass, FalseClass], - default: false, desired_state: false, - description: "Accept an end-user license agreement, automatically." + default: false, desired_state: false, + description: "Accept an end-user license agreement, automatically." end end end diff --git a/lib/chef/resource/kernel_module.rb b/lib/chef/resource/kernel_module.rb index 8b39b0e1d6..882f9de975 100644 --- a/lib/chef/resource/kernel_module.rb +++ b/lib/chef/resource/kernel_module.rb @@ -17,16 +17,16 @@ class Chef introduced "14.3" property :modname, String, - description: "An optional property to set the kernel module name if it differs from the resource block's name.", - name_property: true, identity: true + description: "An optional property to set the kernel module name if it differs from the resource block's name.", + name_property: true, identity: true property :load_dir, String, - description: "The directory to load modules from.", - default: "/etc/modules-load.d" + description: "The directory to load modules from.", + default: "/etc/modules-load.d" property :unload_dir, String, - description: "The modprobe.d directory.", - default: "/etc/modprobe.d" + description: "The modprobe.d directory.", + default: "/etc/modprobe.d" action :install do description "Load kernel module, and ensure it loads on reboot." diff --git a/lib/chef/resource/launchd.rb b/lib/chef/resource/launchd.rb index 99782db284..6cc697eee8 100644 --- a/lib/chef/resource/launchd.rb +++ b/lib/chef/resource/launchd.rb @@ -31,38 +31,38 @@ class Chef allowed_actions :create, :create_if_missing, :delete, :enable, :disable, :restart property :label, String, - identity: true, name_property: true, - description: "The unique identifier for the job." + identity: true, name_property: true, + description: "The unique identifier for the job." property :backup, [Integer, FalseClass], - desired_state: false, - description: "The number of backups to be kept in /var/chef/backup. Set to false to prevent backups from being kept." + desired_state: false, + description: "The number of backups to be kept in /var/chef/backup. Set to false to prevent backups from being kept." property :cookbook, String, - desired_state: false, - description: "The name of the cookbook in which the source files are located." + desired_state: false, + description: "The name of the cookbook in which the source files are located." property :group, [String, Integer], - description: "When launchd is run as the root user, the group to run the job as. If the username property is specified and this property is not, this value is set to the default group for the user." + description: "When launchd is run as the root user, the group to run the job as. If the username property is specified and this property is not, this value is set to the default group for the user." property :plist_hash, Hash, - introduced: "12.19", - description: "A Hash of key value pairs used to create the launchd property list." + introduced: "12.19", + description: "A Hash of key value pairs used to create the launchd property list." property :mode, [String, Integer], - description: "A quoted 3-5 character string that defines the octal mode. For example: '755', '0755', or 00755." + description: "A quoted 3-5 character string that defines the octal mode. For example: '755', '0755', or 00755." property :owner, [String, Integer], - description: "A string or ID that identifies the group owner by user name, including fully qualified user names such as domain_user or user@domain. If this value is not specified, existing owners remain unchanged and new owner assignments use the current user (when necessary)." + description: "A string or ID that identifies the group owner by user name, including fully qualified user names such as domain_user or user@domain. If this value is not specified, existing owners remain unchanged and new owner assignments use the current user (when necessary)." property :path, String, - description: "The path to the directory. Using a fully qualified path is recommended, but is not always required." + description: "The path to the directory. Using a fully qualified path is recommended, but is not always required." property :source, String, - description: "The path to the launchd property list." + description: "The path to the launchd property list." property :session_type, String, - description: "The type of launchd plist to be created. Possible values: system (default) or user." + description: "The type of launchd plist to be created. Possible values: system (default) or user." # StartCalendarInterval has some gotchas so we coerce it to help sanity # check. According to `man 5 launchd.plist`: @@ -74,183 +74,183 @@ class Chef # { "Hour"=>0, "Weekday"=>"6-7"} # will not just run on midnight of Sat and Sun, rather it will run _every_ midnight. property :start_calendar_interval, [Hash, Array], - description: "A Hash (similar to crontab) that defines the calendar frequency at which a job is started or an Array.", - coerce: proc { |type| - # Coerce into an array of hashes to make validation easier - array = if type.is_a?(Array) - type - else - [type] - end - - # Check to make sure that our array only has hashes - unless array.all? { |obj| obj.is_a?(Hash) } - error_msg = "start_calendar_interval must be a single hash or an array of hashes!" - raise Chef::Exceptions::ValidationFailed, error_msg - end - - # Make sure the hashes don't have any incorrect keys/values - array.each do |entry| - allowed_keys = %w{Minute Hour Day Weekday Month} - unless entry.keys.all? { |key| allowed_keys.include?(key) } - failed_keys = entry.keys.reject { |k| allowed_keys.include?(k) }.join(", ") - error_msg = "The following key(s): #{failed_keys} are invalid for start_calendar_interval, must be one of: #{allowed_keys.join(", ")}" - raise Chef::Exceptions::ValidationFailed, error_msg - end - - unless entry.values.all? { |val| val.is_a?(Integer) } - failed_values = entry.values.reject { |val| val.is_a?(Integer) }.join(", ") - error_msg = "Invalid value(s) (#{failed_values}) for start_calendar_interval item. Values must be integers!" - raise Chef::Exceptions::ValidationFailed, error_msg - end - end - - # Don't return array if we only have one entry - if array.size == 1 - array.first - else - array - end - } + description: "A Hash (similar to crontab) that defines the calendar frequency at which a job is started or an Array.", + coerce: proc { |type| + # Coerce into an array of hashes to make validation easier + array = if type.is_a?(Array) + type + else + [type] + end + + # Check to make sure that our array only has hashes + unless array.all? { |obj| obj.is_a?(Hash) } + error_msg = "start_calendar_interval must be a single hash or an array of hashes!" + raise Chef::Exceptions::ValidationFailed, error_msg + end + + # Make sure the hashes don't have any incorrect keys/values + array.each do |entry| + allowed_keys = %w{Minute Hour Day Weekday Month} + unless entry.keys.all? { |key| allowed_keys.include?(key) } + failed_keys = entry.keys.reject { |k| allowed_keys.include?(k) }.join(", ") + error_msg = "The following key(s): #{failed_keys} are invalid for start_calendar_interval, must be one of: #{allowed_keys.join(", ")}" + raise Chef::Exceptions::ValidationFailed, error_msg + end + + unless entry.values.all? { |val| val.is_a?(Integer) } + failed_values = entry.values.reject { |val| val.is_a?(Integer) }.join(", ") + error_msg = "Invalid value(s) (#{failed_values}) for start_calendar_interval item. Values must be integers!" + raise Chef::Exceptions::ValidationFailed, error_msg + end + end + + # Don't return array if we only have one entry + if array.size == 1 + array.first + else + array + end + } property :type, String, - description: "The type of resource. Possible values: daemon (default), agent.", - default: "daemon", coerce: proc { |type| - type = type ? type.downcase : "daemon" - types = %w{daemon agent} - - unless types.include?(type) - error_msg = "type must be daemon or agent" - raise Chef::Exceptions::ValidationFailed, error_msg - end - type - } + description: "The type of resource. Possible values: daemon (default), agent.", + default: "daemon", coerce: proc { |type| + type = type ? type.downcase : "daemon" + types = %w{daemon agent} + + unless types.include?(type) + error_msg = "type must be daemon or agent" + raise Chef::Exceptions::ValidationFailed, error_msg + end + type + } # Apple LaunchD Keys property :abandon_process_group, [ TrueClass, FalseClass ], - description: "If a job dies, all remaining processes with the same process ID may be kept running. Set to true to kill all remaining processes." + description: "If a job dies, all remaining processes with the same process ID may be kept running. Set to true to kill all remaining processes." property :debug, [ TrueClass, FalseClass ], - description: "Sets the log mask to LOG_DEBUG for this job." + description: "Sets the log mask to LOG_DEBUG for this job." property :disabled, [ TrueClass, FalseClass ], default: false, description: "Hints to launchctl to not submit this job to launchd." property :enable_globbing, [ TrueClass, FalseClass ], - description: "Update program arguments before invocation." + description: "Update program arguments before invocation." property :enable_transactions, [ TrueClass, FalseClass ], - description: "Track in-progress transactions; if none, then send the SIGKILL signal." + description: "Track in-progress transactions; if none, then send the SIGKILL signal." property :environment_variables, Hash, - description: "Additional environment variables to set before running a job." + description: "Additional environment variables to set before running a job." property :exit_timeout, Integer, - description: "The amount of time (in seconds) launchd waits before sending a SIGKILL signal." + description: "The amount of time (in seconds) launchd waits before sending a SIGKILL signal." property :hard_resource_limits, Hash, - description: "A Hash of resource limits to be imposed on a job." + description: "A Hash of resource limits to be imposed on a job." property :inetd_compatibility, Hash, - description: "Specifies if a daemon expects to be run as if it were launched from inetd. Set to wait => true to pass standard input, output, and error file descriptors. Set to wait => false to call the accept system call on behalf of the job, and then pass standard input, output, and error file descriptors." + description: "Specifies if a daemon expects to be run as if it were launched from inetd. Set to wait => true to pass standard input, output, and error file descriptors. Set to wait => false to call the accept system call on behalf of the job, and then pass standard input, output, and error file descriptors." property :init_groups, [ TrueClass, FalseClass ], - description: "Specify if initgroups is called before running a job." + description: "Specify if initgroups is called before running a job." property :keep_alive, [ TrueClass, FalseClass, Hash ], - introduced: "12.14", - description: "Keep a job running continuously (true) or allow demand and conditions on the node to determine if the job keeps running (false)." + introduced: "12.14", + description: "Keep a job running continuously (true) or allow demand and conditions on the node to determine if the job keeps running (false)." property :launch_events, [ Hash ], - introduced: "15.1", - description: "Specify higher-level event types to be used as launch-on-demand event sources." + introduced: "15.1", + description: "Specify higher-level event types to be used as launch-on-demand event sources." property :launch_only_once, [ TrueClass, FalseClass ], - description: "Specify if a job can be run only one time. Set this value to true if a job cannot be restarted without a full machine reboot." + description: "Specify if a job can be run only one time. Set this value to true if a job cannot be restarted without a full machine reboot." property :ld_group, String, - description: "The group name." + description: "The group name." property :limit_load_from_hosts, Array, - description: "An array of hosts to which this configuration file does not apply, i.e. 'apply this configuration file to all hosts not specified in this array'." + description: "An array of hosts to which this configuration file does not apply, i.e. 'apply this configuration file to all hosts not specified in this array'." property :limit_load_to_hosts, Array, - description: "An array of hosts to which this configuration file applies." + description: "An array of hosts to which this configuration file applies." property :limit_load_to_session_type, [ Array, String ], - description: "The session type(s) to which this configuration file applies." + description: "The session type(s) to which this configuration file applies." property :low_priority_io, [ TrueClass, FalseClass ], - description: "Specify if the kernel on the node should consider this daemon to be low priority during file system I/O." + description: "Specify if the kernel on the node should consider this daemon to be low priority during file system I/O." property :mach_services, Hash, - description: "Specify services to be registered with the bootstrap subsystem." + description: "Specify services to be registered with the bootstrap subsystem." property :nice, Integer, - description: "The program scheduling priority value in the range -20 to 20." + description: "The program scheduling priority value in the range -20 to 20." property :on_demand, [ TrueClass, FalseClass ], - description: "Keep a job alive. Only applies to macOS version 10.4 (and earlier); use keep_alive instead for newer versions." + description: "Keep a job alive. Only applies to macOS version 10.4 (and earlier); use keep_alive instead for newer versions." property :process_type, String, - description: "The intended purpose of the job: Adaptive, Background, Interactive, or Standard." + description: "The intended purpose of the job: Adaptive, Background, Interactive, or Standard." property :program, String, - description: "The first argument of execvp, typically the file name associated with the file to be executed. This value must be specified if program_arguments is not specified, and vice-versa." + description: "The first argument of execvp, typically the file name associated with the file to be executed. This value must be specified if program_arguments is not specified, and vice-versa." property :program_arguments, Array, - description: "The second argument of execvp. If program is not specified, this property must be specified and will be handled as if it were the first argument." + description: "The second argument of execvp. If program is not specified, this property must be specified and will be handled as if it were the first argument." property :queue_directories, Array, - description: "An array of non-empty directories which, if any are modified, will cause a job to be started." + description: "An array of non-empty directories which, if any are modified, will cause a job to be started." property :root_directory, String, - description: "chroot to this directory, and then run the job." + description: "chroot to this directory, and then run the job." property :run_at_load, [ TrueClass, FalseClass ], - description: "Launch a job once (at the time it is loaded)." + description: "Launch a job once (at the time it is loaded)." property :sockets, Hash, - description: "A Hash of on-demand sockets that notify launchd when a job should be run." + description: "A Hash of on-demand sockets that notify launchd when a job should be run." property :soft_resource_limits, Array, - description: "A Hash of resource limits to be imposed on a job." + description: "A Hash of resource limits to be imposed on a job." property :standard_error_path, String, - description: "The file to which standard error (stderr) is sent." + description: "The file to which standard error (stderr) is sent." property :standard_in_path, String, - description: "The file to which standard input (stdin) is sent." + description: "The file to which standard input (stdin) is sent." property :standard_out_path, String, - description: "The file to which standard output (stdout) is sent." + description: "The file to which standard output (stdout) is sent." property :start_interval, Integer, - description: "The frequency (in seconds) at which a job is started." + description: "The frequency (in seconds) at which a job is started." property :start_on_mount, [ TrueClass, FalseClass ], - description: "Start a job every time a file system is mounted." + description: "Start a job every time a file system is mounted." property :throttle_interval, Integer, - description: "The frequency (in seconds) at which jobs are allowed to spawn." + description: "The frequency (in seconds) at which jobs are allowed to spawn." property :time_out, Integer, - description: "The amount of time (in seconds) a job may be idle before it times out. If no value is specified, the default timeout value for launchd will be used." + description: "The amount of time (in seconds) a job may be idle before it times out. If no value is specified, the default timeout value for launchd will be used." property :umask, Integer, - description: "A decimal value to pass to umask before running a job." + description: "A decimal value to pass to umask before running a job." property :username, String, - description: "When launchd is run as the root user, the user to run the job as." + description: "When launchd is run as the root user, the user to run the job as." property :wait_for_debugger, [ TrueClass, FalseClass ], - description: "Specify if launchd has a job wait for a debugger to attach before executing code." + description: "Specify if launchd has a job wait for a debugger to attach before executing code." property :watch_paths, Array, - description: "An array of paths which, if any are modified, will cause a job to be started." + description: "An array of paths which, if any are modified, will cause a job to be started." property :working_directory, String, - description: "Chdir to this directory, and then run the job." + description: "Chdir to this directory, and then run the job." end end end diff --git a/lib/chef/resource/link.rb b/lib/chef/resource/link.rb index 11796001e3..66388a6463 100644 --- a/lib/chef/resource/link.rb +++ b/lib/chef/resource/link.rb @@ -48,24 +48,24 @@ class Chef end property :target_file, String, - description: "An optional property to set the target file if it differs from the resource block's name.", - name_property: true, identity: true + description: "An optional property to set the target file if it differs from the resource block's name.", + name_property: true, identity: true property :to, String, - description: "The actual file to which the link is to be created." + description: "The actual file to which the link is to be created." property :link_type, [String, Symbol], - description: "The type of link: :symbolic or :hard.", - coerce: proc { |arg| arg.kind_of?(String) ? arg.to_sym : arg }, - equal_to: [ :symbolic, :hard ], default: :symbolic + description: "The type of link: :symbolic or :hard.", + coerce: proc { |arg| arg.kind_of?(String) ? arg.to_sym : arg }, + equal_to: [ :symbolic, :hard ], default: :symbolic property :group, [String, Integer], - description: "A group name or ID number that identifies the group associated with a symbolic link.", - regex: [Chef::Config[:group_valid_regex]] + description: "A group name or ID number that identifies the group associated with a symbolic link.", + regex: [Chef::Config[:group_valid_regex]] property :owner, [String, Integer], - description: "The owner associated with a symbolic link.", - regex: [Chef::Config[:user_valid_regex]] + description: "The owner associated with a symbolic link.", + regex: [Chef::Config[:user_valid_regex]] # make link quack like a file (XXX: not for public consumption) def path diff --git a/lib/chef/resource/locale.rb b/lib/chef/resource/locale.rb index 73a67f215e..f833a4e7d3 100644 --- a/lib/chef/resource/locale.rb +++ b/lib/chef/resource/locale.rb @@ -32,27 +32,27 @@ class Chef LOCALE_PLATFORM_FAMILIES = %w{debian}.freeze property :lang, String, - description: "Sets the default system language.", - regex: [LOCALE_REGEX], - validation_message: "The provided lang is not valid. It should be a non-empty string without any leading whitespaces." + description: "Sets the default system language.", + regex: [LOCALE_REGEX], + validation_message: "The provided lang is not valid. It should be a non-empty string without any leading whitespaces." property :lc_env, Hash, - description: "A Hash of LC_* env variables in the form of ({ 'LC_ENV_VARIABLE' => 'VALUE' }).", - default: lazy { {} }, - coerce: proc { |h| - if h.respond_to?(:keys) - invalid_keys = h.keys - LC_VARIABLES - unless invalid_keys.empty? - error_msg = "Key of option lc_env must be equal to one of: \"#{LC_VARIABLES.join('", "')}\"! You passed \"#{invalid_keys.join(', ')}\"." - raise Chef::Exceptions::ValidationFailed, error_msg - end - end - unless h.values.all? { |x| x =~ LOCALE_REGEX } - error_msg = "Values of option lc_env should be non-empty string without any leading whitespaces." - raise Chef::Exceptions::ValidationFailed, error_msg - end - h - } + description: "A Hash of LC_* env variables in the form of ({ 'LC_ENV_VARIABLE' => 'VALUE' }).", + default: lazy { {} }, + coerce: proc { |h| + if h.respond_to?(:keys) + invalid_keys = h.keys - LC_VARIABLES + unless invalid_keys.empty? + error_msg = "Key of option lc_env must be equal to one of: \"#{LC_VARIABLES.join('", "')}\"! You passed \"#{invalid_keys.join(', ')}\"." + raise Chef::Exceptions::ValidationFailed, error_msg + end + end + unless h.values.all? { |x| x =~ LOCALE_REGEX } + error_msg = "Values of option lc_env should be non-empty string without any leading whitespaces." + raise Chef::Exceptions::ValidationFailed, error_msg + end + h + } # @deprecated Use {#lc_env} instead of this property. # {#lc_env} uses Hash with specific LC var as key. diff --git a/lib/chef/resource/log.rb b/lib/chef/resource/log.rb index b642b5dee2..4f76ea12de 100644 --- a/lib/chef/resource/log.rb +++ b/lib/chef/resource/log.rb @@ -39,12 +39,12 @@ class Chef " of the log resource.)" property :message, String, - name_property: true, identity: true, - description: "The message to be added to a log file. If not specified we'll use the resource's name instead." + name_property: true, identity: true, + description: "The message to be added to a log file. If not specified we'll use the resource's name instead." property :level, Symbol, - equal_to: [ :debug, :info, :warn, :error, :fatal ], default: :info, - description: "The logging level to display this message at." + equal_to: [ :debug, :info, :warn, :error, :fatal ], default: :info, + description: "The logging level to display this message at." allowed_actions :write default_action :write diff --git a/lib/chef/resource/macos_userdefaults.rb b/lib/chef/resource/macos_userdefaults.rb index 9499cebd0c..75704400d5 100644 --- a/lib/chef/resource/macos_userdefaults.rb +++ b/lib/chef/resource/macos_userdefaults.rb @@ -29,37 +29,37 @@ class Chef introduced "14.0" property :domain, String, - description: "The domain that the user defaults belong to.", - required: true + description: "The domain that the user defaults belong to.", + required: true property :global, [TrueClass, FalseClass], - description: "Determines whether or not the domain is global.", - default: false + description: "Determines whether or not the domain is global.", + default: false property :key, String, - description: "The preference key." + description: "The preference key." property :value, [Integer, Float, String, TrueClass, FalseClass, Hash, Array], - description: "The value of the key.", - required: true + description: "The value of the key.", + required: true property :type, String, - description: "The value type of the preference key.", - default: "" + description: "The value type of the preference key.", + default: "" property :user, String, - description: "The system user that the default will be applied to." + description: "The system user that the default will be applied to." property :sudo, [TrueClass, FalseClass], - description: "Set to true if the setting you wish to modify requires privileged access.", - default: false, - desired_state: false + description: "Set to true if the setting you wish to modify requires privileged access.", + default: false, + desired_state: false # @todo this should get refactored away: https://github.com/chef/chef/issues/7622 property :is_set, [TrueClass, FalseClass], - default: false, - desired_state: false, - skip_docs: true + default: false, + desired_state: false, + skip_docs: true # coerce various ways of representing a boolean into either 0 (false) or 1 (true) # which is what the defaults CLI expects. Why? Well defaults itself accepts a few diff --git a/lib/chef/resource/macosx_service.rb b/lib/chef/resource/macosx_service.rb index f6b463e61b..6c055a1ee9 100644 --- a/lib/chef/resource/macosx_service.rb +++ b/lib/chef/resource/macosx_service.rb @@ -28,7 +28,7 @@ class Chef description "Use the macosx_service resource to manage services on the macOS platform." property :plist, String, - description: "A plist to use in the case where the filename and label for the service do not match." + description: "A plist to use in the case where the filename and label for the service do not match." property :session_type, String diff --git a/lib/chef/resource/mdadm.rb b/lib/chef/resource/mdadm.rb index 1cec1d598e..aff90059a7 100644 --- a/lib/chef/resource/mdadm.rb +++ b/lib/chef/resource/mdadm.rb @@ -33,35 +33,35 @@ class Chef allowed_actions :create, :assemble, :stop property :chunk, Integer, - default: 16, - description: "The chunk size. This property should not be used for a RAID 1 mirrored pair (i.e. when the level property is set to 1)." + default: 16, + description: "The chunk size. This property should not be used for a RAID 1 mirrored pair (i.e. when the level property is set to 1)." property :devices, Array, - default: lazy { [] }, - description: "The devices to be part of a RAID array." + default: lazy { [] }, + description: "The devices to be part of a RAID array." # @todo this should get refactored away property :exists, [ TrueClass, FalseClass ], - default: false, - skip_docs: true + default: false, + skip_docs: true property :level, Integer, - default: 1, - description: "The RAID level." + default: 1, + description: "The RAID level." property :metadata, String, - default: "0.90", - description: "The superblock type for RAID metadata." + default: "0.90", + description: "The superblock type for RAID metadata." property :bitmap, String, - description: "The path to a file in which a write-intent bitmap is stored." + description: "The path to a file in which a write-intent bitmap is stored." property :raid_device, String, - identity: true, name_property: true, - description: "An optional property to specify the name of the RAID device if it differs from the resource block's name." + identity: true, name_property: true, + description: "An optional property to specify the name of the RAID device if it differs from the resource block's name." property :layout, String, - description: "The RAID5 parity algorithm. Possible values: left-asymmetric (or la), left-symmetric (or ls), right-asymmetric (or ra), or right-symmetric (or rs)." + description: "The RAID5 parity algorithm. Possible values: left-asymmetric (or la), left-symmetric (or ls), right-asymmetric (or ra), or right-symmetric (or rs)." end end end diff --git a/lib/chef/resource/mount.rb b/lib/chef/resource/mount.rb index 586aa6e375..b800387975 100644 --- a/lib/chef/resource/mount.rb +++ b/lib/chef/resource/mount.rb @@ -29,13 +29,13 @@ class Chef # this is a poor API please do not re-use this pattern property :supports, [Array, Hash], - description: "Specify a Hash of supported mount features.", - default: lazy { { remount: false } }, - coerce: proc { |x| x.is_a?(Array) ? x.each_with_object({}) { |i, m| m[i] = true } : x } + description: "Specify a Hash of supported mount features.", + default: lazy { { remount: false } }, + coerce: proc { |x| x.is_a?(Array) ? x.each_with_object({}) { |i, m| m[i] = true } : x } property :password, String, - description: "Windows only:. Use to specify the password for username.", - sensitive: true + description: "Windows only:. Use to specify the password for username.", + sensitive: true property :mount_point, String, name_property: true, description: "The directory (or path) in which the device is to be mounted. Defaults to the name of the resource block if not provided." @@ -44,44 +44,44 @@ class Chef description: "Required for :umount and :remount actions (for the purpose of checking the mount command output for presence). The special block device or remote node, a label, or a uuid to be mounted." property :device_type, [String, Symbol], - description: "The type of device: :device, :label, or :uuid", - coerce: proc { |arg| arg.kind_of?(String) ? arg.to_sym : arg }, - default: :device, - equal_to: RUBY_PLATFORM =~ /solaris/i ? %i{ device } : %i{ device label uuid } + description: "The type of device: :device, :label, or :uuid", + coerce: proc { |arg| arg.kind_of?(String) ? arg.to_sym : arg }, + default: :device, + equal_to: RUBY_PLATFORM =~ /solaris/i ? %i{ device } : %i{ device label uuid } # @todo this should get refactored away: https://github.com/chef/chef/issues/7621 property :mounted, [TrueClass, FalseClass], default: false, skip_docs: true property :fsck_device, String, - description: "Solaris only: The fsck device.", - default: "-" + description: "Solaris only: The fsck device.", + default: "-" property :fstype, [String, nil], - description: "The file system type (fstype) of the device.", - default: "auto" + description: "The file system type (fstype) of the device.", + default: "auto" property :options, [Array, String, nil], - description: "An array or comma separated list of options for the mount.", - coerce: proc { |arg| arg.kind_of?(String) ? arg.split(",") : arg }, - default: %w{defaults} + description: "An array or comma separated list of options for the mount.", + coerce: proc { |arg| arg.kind_of?(String) ? arg.split(",") : arg }, + default: %w{defaults} property :dump, [Integer, FalseClass], - description: "The dump frequency (in days) used while creating a file systems table (fstab) entry.", - default: 0 + description: "The dump frequency (in days) used while creating a file systems table (fstab) entry.", + default: 0 property :pass, [Integer, FalseClass], - description: "The pass number used by the file system check (fsck) command while creating a file systems table (fstab) entry.", - default: 2 + description: "The pass number used by the file system check (fsck) command while creating a file systems table (fstab) entry.", + default: 2 property :enabled, [TrueClass, FalseClass], - description: "Use to specify if a mounted file system is enabled.", - default: false + description: "Use to specify if a mounted file system is enabled.", + default: false property :username, String, - description: "Windows only: Use to specify the user name." + description: "Windows only: Use to specify the user name." property :domain, String, - description: "Windows only: Use to specify the domain in which the username and password are located." + description: "Windows only: Use to specify the domain in which the username and password are located." private diff --git a/lib/chef/resource/msu_package.rb b/lib/chef/resource/msu_package.rb index 628af49184..75515b4f78 100644 --- a/lib/chef/resource/msu_package.rb +++ b/lib/chef/resource/msu_package.rb @@ -34,13 +34,13 @@ class Chef default_action :install property :source, String, - description: "The local file path or URL for the MSU package.", - coerce: (proc do |s| - unless s.nil? - uri_scheme?(s) ? s : Chef::Util::PathHelper.canonical_path(s, false) - end - end), - default: lazy { |r| r.package_name } + description: "The local file path or URL for the MSU package.", + coerce: (proc do |s| + unless s.nil? + uri_scheme?(s) ? s : Chef::Util::PathHelper.canonical_path(s, false) + end + end), + default: lazy { |r| r.package_name } property :checksum, String, desired_state: false, description: "SHA-256 digest used to verify the checksum of the downloaded MSU package." diff --git a/lib/chef/resource/ohai.rb b/lib/chef/resource/ohai.rb index 68a7e487b9..4dca91daea 100644 --- a/lib/chef/resource/ohai.rb +++ b/lib/chef/resource/ohai.rb @@ -29,7 +29,7 @@ class Chef description "Use the ohai resource to reload the Ohai configuration on a node. This allows recipes that change system attributes (like a recipe that adds a user) to refer to those attributes later on during the #{Chef::Dist::CLIENT} run." property :plugin, String, - description: "The name of an Ohai plugin to be reloaded. If this property is not specified, the #{Chef::Dist::CLIENT} will reload all plugins." + description: "The name of an Ohai plugin to be reloaded. If this property is not specified, the #{Chef::Dist::CLIENT} will reload all plugins." default_action :reload allowed_actions :reload diff --git a/lib/chef/resource/ohai_hint.rb b/lib/chef/resource/ohai_hint.rb index 2d54e3d568..c11ef78950 100644 --- a/lib/chef/resource/ohai_hint.rb +++ b/lib/chef/resource/ohai_hint.rb @@ -27,15 +27,15 @@ class Chef introduced "14.0" property :hint_name, String, - description: "An optional property to set the hint name if it differs from the resource block's name.", - name_property: true + description: "An optional property to set the hint name if it differs from the resource block's name.", + name_property: true property :content, Hash, - description: "Values to include in the hint file." + description: "Values to include in the hint file." property :compile_time, [TrueClass, FalseClass], - description: "Determines whether or not the resource is executed during the compile time phase.", - default: true, desired_state: false + description: "Determines whether or not the resource is executed during the compile time phase.", + default: true, desired_state: false action :create do description "Create an Ohai hint file." diff --git a/lib/chef/resource/openssl_dhparam.rb b/lib/chef/resource/openssl_dhparam.rb index 4799761e79..254a840a48 100644 --- a/lib/chef/resource/openssl_dhparam.rb +++ b/lib/chef/resource/openssl_dhparam.rb @@ -30,30 +30,30 @@ class Chef introduced "14.0" property :path, String, - description: "An optional property for specifying the path to write the file to if it differs from the resource block's name.", - name_property: true + description: "An optional property for specifying the path to write the file to if it differs from the resource block's name.", + name_property: true property :key_length, Integer, - equal_to: [1024, 2048, 4096, 8192], - validation_message: "key_length must be 1024, 2048, 4096, or 8192.", - description: "The desired bit length of the generated key.", - default: 2048 + equal_to: [1024, 2048, 4096, 8192], + validation_message: "key_length must be 1024, 2048, 4096, or 8192.", + description: "The desired bit length of the generated key.", + default: 2048 property :generator, Integer, - equal_to: [2, 5], - validation_message: "generator must be either 2 or 5.", - description: "The desired Diffie-Hellmann generator.", - default: 2 + equal_to: [2, 5], + validation_message: "generator must be either 2 or 5.", + description: "The desired Diffie-Hellmann generator.", + default: 2 property :owner, [String, Integer], - description: "The owner applied to all files created by the resource." + description: "The owner applied to all files created by the resource." property :group, [String, Integer], - description: "The group ownership applied to all files created by the resource." + description: "The group ownership applied to all files created by the resource." property :mode, [Integer, String], - description: "The permission mode applied to all files created by the resource.", - default: "0640" + description: "The permission mode applied to all files created by the resource.", + default: "0640" action :create do description "Create the dhparam file." diff --git a/lib/chef/resource/openssl_ec_private_key.rb b/lib/chef/resource/openssl_ec_private_key.rb index 996dd46734..746322dfc5 100644 --- a/lib/chef/resource/openssl_ec_private_key.rb +++ b/lib/chef/resource/openssl_ec_private_key.rb @@ -30,36 +30,36 @@ class Chef introduced "14.4" property :path, String, - description: "An optional property for specifying the path to write the file to if it differs from the resource block's name.", - name_property: true + description: "An optional property for specifying the path to write the file to if it differs from the resource block's name.", + name_property: true property :key_curve, String, - equal_to: %w{secp384r1 secp521r1 prime256v1 secp224r1 secp256k1}, - description: "The desired curve of the generated key (if key_type is equal to 'ec'). Run openssl ecparam -list_curves to see available options.", - default: "prime256v1" + equal_to: %w{secp384r1 secp521r1 prime256v1 secp224r1 secp256k1}, + description: "The desired curve of the generated key (if key_type is equal to 'ec'). Run openssl ecparam -list_curves to see available options.", + default: "prime256v1" property :key_pass, String, - description: "The desired passphrase for the key." + description: "The desired passphrase for the key." property :key_cipher, String, - equal_to: OpenSSL::Cipher.ciphers, - validation_message: "key_cipher must be a cipher known to openssl. Run `openssl list-cipher-algorithms` to see available options.", - description: "The designed cipher to use when generating your key. Run `openssl list-cipher-algorithms` to see available options.", - default: "des3" + equal_to: OpenSSL::Cipher.ciphers, + validation_message: "key_cipher must be a cipher known to openssl. Run `openssl list-cipher-algorithms` to see available options.", + description: "The designed cipher to use when generating your key. Run `openssl list-cipher-algorithms` to see available options.", + default: "des3" property :owner, [String, Integer], - description: "The owner applied to all files created by the resource." + description: "The owner applied to all files created by the resource." property :group, [String, Integer], - description: "The group ownership applied to all files created by the resource." + description: "The group ownership applied to all files created by the resource." property :mode, [Integer, String], - description: "The permission mode applied to all files created by the resource.", - default: "0600" + description: "The permission mode applied to all files created by the resource.", + default: "0600" property :force, [TrueClass, FalseClass], - description: "Force creation of the key even if the same key already exists on the node.", - default: false, desired_state: false + description: "Force creation of the key even if the same key already exists on the node.", + default: false, desired_state: false action :create do description "Generate the ec private key" diff --git a/lib/chef/resource/openssl_ec_public_key.rb b/lib/chef/resource/openssl_ec_public_key.rb index e4ef6b048e..0be9885df6 100644 --- a/lib/chef/resource/openssl_ec_public_key.rb +++ b/lib/chef/resource/openssl_ec_public_key.rb @@ -30,27 +30,27 @@ class Chef introduced "14.4" property :path, String, - description: "An optional property for specifying the path to write the file to if it differs from the resource block's name.", - name_property: true + description: "An optional property for specifying the path to write the file to if it differs from the resource block's name.", + name_property: true property :private_key_path, String, - description: "The path to the private key file." + description: "The path to the private key file." property :private_key_content, String, - description: "The content of the private key including new lines. This property is used in place of private_key_path in instances where you want to avoid having to first write the private key to disk" + description: "The content of the private key including new lines. This property is used in place of private_key_path in instances where you want to avoid having to first write the private key to disk" property :private_key_pass, String, - description: "The passphrase of the provided private key." + description: "The passphrase of the provided private key." property :owner, [String, Integer], - description: "The owner applied to all files created by the resource." + description: "The owner applied to all files created by the resource." property :group, [String, Integer], - description: "The group ownership applied to all files created by the resource." + description: "The group ownership applied to all files created by the resource." property :mode, [Integer, String], - description: "The permission mode applied to all files created by the resource.", - default: "0640" + description: "The permission mode applied to all files created by the resource.", + default: "0640" action :create do description "Generate the ec public key from a private key" diff --git a/lib/chef/resource/openssl_rsa_private_key.rb b/lib/chef/resource/openssl_rsa_private_key.rb index 4eee99a7f0..38ffa2c394 100644 --- a/lib/chef/resource/openssl_rsa_private_key.rb +++ b/lib/chef/resource/openssl_rsa_private_key.rb @@ -31,37 +31,37 @@ class Chef introduced "14.0" property :path, String, - description: "An optional property for specifying the path to write the file to if it differs from the resource block's name.", - name_property: true + description: "An optional property for specifying the path to write the file to if it differs from the resource block's name.", + name_property: true property :key_length, Integer, - equal_to: [1024, 2048, 4096, 8192], - validation_message: "key_length (bits) must be 1024, 2048, 4096, or 8192!", - description: "The desired bit length of the generated key.", - default: 2048 + equal_to: [1024, 2048, 4096, 8192], + validation_message: "key_length (bits) must be 1024, 2048, 4096, or 8192!", + description: "The desired bit length of the generated key.", + default: 2048 property :key_pass, String, - description: "The desired passphrase for the key." + description: "The desired passphrase for the key." property :key_cipher, String, - equal_to: OpenSSL::Cipher.ciphers, - validation_message: "key_cipher must be a cipher known to openssl. Run `openssl list-cipher-algorithms` to see available options.", - description: "The designed cipher to use when generating your key. Run `openssl list-cipher-algorithms` to see available options.", - default: "des3" + equal_to: OpenSSL::Cipher.ciphers, + validation_message: "key_cipher must be a cipher known to openssl. Run `openssl list-cipher-algorithms` to see available options.", + description: "The designed cipher to use when generating your key. Run `openssl list-cipher-algorithms` to see available options.", + default: "des3" property :owner, [String, Integer], - description: "The owner applied to all files created by the resource." + description: "The owner applied to all files created by the resource." property :group, [String, Integer], - description: "The group ownership applied to all files created by the resource." + description: "The group ownership applied to all files created by the resource." property :mode, [Integer, String], - description: "The permission mode applied to all files created by the resource.", - default: "0600" + description: "The permission mode applied to all files created by the resource.", + default: "0600" property :force, [TrueClass, FalseClass], - description: "Force creation of the key even if the same key already exists on the node.", - default: false, desired_state: false + description: "Force creation of the key even if the same key already exists on the node.", + default: false, desired_state: false action :create do description "Create the RSA private key." diff --git a/lib/chef/resource/openssl_rsa_public_key.rb b/lib/chef/resource/openssl_rsa_public_key.rb index c445b49b75..c7c125fb9e 100644 --- a/lib/chef/resource/openssl_rsa_public_key.rb +++ b/lib/chef/resource/openssl_rsa_public_key.rb @@ -30,27 +30,27 @@ class Chef introduced "14.0" property :path, String, - description: "An optional property for specifying the path to the public key if it differs from the resource block's name.", - name_property: true + description: "An optional property for specifying the path to the public key if it differs from the resource block's name.", + name_property: true property :private_key_path, String, - description: "The path to the private key file." + description: "The path to the private key file." property :private_key_content, String, - description: "The content of the private key, including new lines. This property is used in place of private_key_path in instances where you want to avoid having to first write the private key to disk." + description: "The content of the private key, including new lines. This property is used in place of private_key_path in instances where you want to avoid having to first write the private key to disk." property :private_key_pass, String, - description: "The passphrase of the provided private key." + description: "The passphrase of the provided private key." property :owner, [String, Integer], - description: "The owner applied to all files created by the resource." + description: "The owner applied to all files created by the resource." property :group, [String, Integer], - description: "The group ownership applied to all files created by the resource." + description: "The group ownership applied to all files created by the resource." property :mode, [Integer, String], - description: "The permission mode applied to all files created by the resource.", - default: "0640" + description: "The permission mode applied to all files created by the resource.", + default: "0640" action :create do description "Create the RSA public key." diff --git a/lib/chef/resource/openssl_x509_certificate.rb b/lib/chef/resource/openssl_x509_certificate.rb index 96a0ec3d6d..8353f5ad09 100644 --- a/lib/chef/resource/openssl_x509_certificate.rb +++ b/lib/chef/resource/openssl_x509_certificate.rb @@ -31,83 +31,83 @@ class Chef introduced "14.4" property :path, String, - description: "An optional property for specifying the path to write the file to if it differs from the resource block's name.", - name_property: true + description: "An optional property for specifying the path to write the file to if it differs from the resource block's name.", + name_property: true property :owner, [String, Integer], - description: "The owner applied to all files created by the resource." + description: "The owner applied to all files created by the resource." property :group, [String, Integer], - description: "The group ownership applied to all files created by the resource." + description: "The group ownership applied to all files created by the resource." property :expire, Integer, - description: "Value representing the number of days from now through which the issued certificate cert will remain valid. The certificate will expire after this period.", - default: 365 + description: "Value representing the number of days from now through which the issued certificate cert will remain valid. The certificate will expire after this period.", + default: 365 property :mode, [Integer, String], - description: "The permission mode applied to all files created by the resource." + description: "The permission mode applied to all files created by the resource." property :country, String, - description: "Value for the C certificate field." + description: "Value for the C certificate field." property :state, String, - description: "Value for the ST certificate field." + description: "Value for the ST certificate field." property :city, String, - description: "Value for the L certificate field." + description: "Value for the L certificate field." property :org, String, - description: "Value for the O certificate field." + description: "Value for the O certificate field." property :org_unit, String, - description: "Value for the OU certificate field." + description: "Value for the OU certificate field." property :common_name, String, - description: "Value for the CN certificate field." + description: "Value for the CN certificate field." property :email, String, - description: "Value for the email certificate field." + description: "Value for the email certificate field." property :extensions, Hash, - description: "Hash of X509 Extensions entries, in format { 'keyUsage' => { 'values' => %w( keyEncipherment digitalSignature), 'critical' => true } }.", - default: lazy { Hash.new } + description: "Hash of X509 Extensions entries, in format { 'keyUsage' => { 'values' => %w( keyEncipherment digitalSignature), 'critical' => true } }.", + default: lazy { Hash.new } property :subject_alt_name, Array, - description: "Array of Subject Alternative Name entries, in format DNS:example.com or IP:1.2.3.4.", - default: lazy { [] } + description: "Array of Subject Alternative Name entries, in format DNS:example.com or IP:1.2.3.4.", + default: lazy { [] } property :key_file, String, - description: "The path to a certificate key file on the filesystem. If the key_file property is specified, the resource will attempt to source a key from this location. If no key file is found, the resource will generate a new key file at this location. If the key_file property is not specified, the resource will generate a key file in the same directory as the generated certificate, with the same name as the generated certificate." + description: "The path to a certificate key file on the filesystem. If the key_file property is specified, the resource will attempt to source a key from this location. If no key file is found, the resource will generate a new key file at this location. If the key_file property is not specified, the resource will generate a key file in the same directory as the generated certificate, with the same name as the generated certificate." property :key_pass, String, - description: "The passphrase for an existing key's passphrase." + description: "The passphrase for an existing key's passphrase." property :key_type, String, - equal_to: %w{rsa ec}, - description: "The desired type of the generated key (rsa or ec).", - default: "rsa" + equal_to: %w{rsa ec}, + description: "The desired type of the generated key (rsa or ec).", + default: "rsa" property :key_length, Integer, - equal_to: [1024, 2048, 4096, 8192], - description: "The desired bit length of the generated key (if key_type is equal to 'rsa').", - default: 2048 + equal_to: [1024, 2048, 4096, 8192], + description: "The desired bit length of the generated key (if key_type is equal to 'rsa').", + default: 2048 property :key_curve, String, - description: "The desired curve of the generated key (if key_type is equal to 'ec'). Run openssl ecparam -list_curves to see available options.", - equal_to: %w{secp384r1 secp521r1 prime256v1}, - default: "prime256v1" + description: "The desired curve of the generated key (if key_type is equal to 'ec'). Run openssl ecparam -list_curves to see available options.", + equal_to: %w{secp384r1 secp521r1 prime256v1}, + default: "prime256v1" property :csr_file, String, - description: "The path to a X509 Certificate Request (CSR) on the filesystem. If the csr_file property is specified, the resource will attempt to source a CSR from this location. If no CSR file is found, the resource will generate a Self-Signed Certificate and the certificate fields must be specified (common_name at last)." + description: "The path to a X509 Certificate Request (CSR) on the filesystem. If the csr_file property is specified, the resource will attempt to source a CSR from this location. If no CSR file is found, the resource will generate a Self-Signed Certificate and the certificate fields must be specified (common_name at last)." property :ca_cert_file, String, - description: "The path to the CA X509 Certificate on the filesystem. If the ca_cert_file property is specified, the ca_key_file property must also be specified, the certificate will be signed with them." + description: "The path to the CA X509 Certificate on the filesystem. If the ca_cert_file property is specified, the ca_key_file property must also be specified, the certificate will be signed with them." property :ca_key_file, String, - description: "The path to the CA private key on the filesystem. If the ca_key_file property is specified, the 'ca_cert_file' property must also be specified, the certificate will be signed with them." + description: "The path to the CA private key on the filesystem. If the ca_key_file property is specified, the 'ca_cert_file' property must also be specified, the certificate will be signed with them." property :ca_key_pass, String, - description: "The passphrase for CA private key's passphrase." + description: "The passphrase for CA private key's passphrase." action :create do description "Generate a certificate" diff --git a/lib/chef/resource/openssl_x509_crl.rb b/lib/chef/resource/openssl_x509_crl.rb index a04ef2e5e2..650db6863e 100644 --- a/lib/chef/resource/openssl_x509_crl.rb +++ b/lib/chef/resource/openssl_x509_crl.rb @@ -30,43 +30,43 @@ class Chef introduced "14.4" property :path, String, - description: "An optional property for specifying the path to write the file to if it differs from the resource block's name.", - name_property: true + description: "An optional property for specifying the path to write the file to if it differs from the resource block's name.", + name_property: true property :serial_to_revoke, [Integer, String], - description: "Serial of the X509 Certificate to revoke." + description: "Serial of the X509 Certificate to revoke." property :revocation_reason, Integer, - description: "Reason for the revocation.", - default: 0 + description: "Reason for the revocation.", + default: 0 property :expire, Integer, - description: "Value representing the number of days from now through which the issued CRL will remain valid. The CRL will expire after this period.", - default: 8 + description: "Value representing the number of days from now through which the issued CRL will remain valid. The CRL will expire after this period.", + default: 8 property :renewal_threshold, Integer, - description: "Number of days before the expiration. It this threshold is reached, the CRL will be renewed.", - default: 1 + description: "Number of days before the expiration. It this threshold is reached, the CRL will be renewed.", + default: 1 property :ca_cert_file, String, - description: "The path to the CA X509 Certificate on the filesystem. If the ca_cert_file property is specified, the ca_key_file property must also be specified, the CRL will be signed with them.", - required: true + description: "The path to the CA X509 Certificate on the filesystem. If the ca_cert_file property is specified, the ca_key_file property must also be specified, the CRL will be signed with them.", + required: true property :ca_key_file, String, - description: "The path to the CA private key on the filesystem. If the ca_key_file property is specified, the ca_cert_file property must also be specified, the CRL will be signed with them.", - required: true + description: "The path to the CA private key on the filesystem. If the ca_key_file property is specified, the ca_cert_file property must also be specified, the CRL will be signed with them.", + required: true property :ca_key_pass, String, - description: "The passphrase for CA private key's passphrase." + description: "The passphrase for CA private key's passphrase." property :owner, [String, Integer], - description: "The owner permission for the CRL file." + description: "The owner permission for the CRL file." property :group, [String, Integer], - description: "The group permission for the CRL file." + description: "The group permission for the CRL file." property :mode, [Integer, String], - description: "The permission mode of the CRL file." + description: "The permission mode of the CRL file." action :create do description "Create the CRL file." diff --git a/lib/chef/resource/openssl_x509_request.rb b/lib/chef/resource/openssl_x509_request.rb index b33a95dfaf..6fa3d6db9e 100644 --- a/lib/chef/resource/openssl_x509_request.rb +++ b/lib/chef/resource/openssl_x509_request.rb @@ -33,53 +33,53 @@ class Chef description: "An optional property for specifying the path to write the file to if it differs from the resource block's name." property :owner, [String, Integer], - description: "The owner applied to all files created by the resource." + description: "The owner applied to all files created by the resource." property :group, [String, Integer], - description: "The group ownership applied to all files created by the resource." + description: "The group ownership applied to all files created by the resource." property :mode, [Integer, String], - description: "The permission mode applied to all files created by the resource." + description: "The permission mode applied to all files created by the resource." property :country, String, - description: "Value for the C certificate field." + description: "Value for the C certificate field." property :state, String, - description: "Value for the ST certificate field." + description: "Value for the ST certificate field." property :city, String, - description: "Value for the L certificate field." + description: "Value for the L certificate field." property :org, String, - description: "Value for the O certificate field." + description: "Value for the O certificate field." property :org_unit, String, - description: "Value for the OU certificate field." + description: "Value for the OU certificate field." property :common_name, String, - required: true, - description: "Value for the CN certificate field." + required: true, + description: "Value for the CN certificate field." property :email, String, - description: "Value for the email certificate field." + description: "Value for the email certificate field." property :key_file, String, - description: "The path to a certificate key file on the filesystem. If the key_file property is specified, the resource will attempt to source a key from this location. If no key file is found, the resource will generate a new key file at this location. If the key_file property is not specified, the resource will generate a key file in the same directory as the generated certificate, with the same name as the generated certificate." + description: "The path to a certificate key file on the filesystem. If the key_file property is specified, the resource will attempt to source a key from this location. If no key file is found, the resource will generate a new key file at this location. If the key_file property is not specified, the resource will generate a key file in the same directory as the generated certificate, with the same name as the generated certificate." property :key_pass, String, - description: "The passphrase for an existing key's passphrase." + description: "The passphrase for an existing key's passphrase." property :key_type, String, - equal_to: %w{rsa ec}, default: "ec", - description: "The desired type of the generated key (rsa or ec)." + equal_to: %w{rsa ec}, default: "ec", + description: "The desired type of the generated key (rsa or ec)." property :key_length, Integer, - equal_to: [1024, 2048, 4096, 8192], default: 2048, - description: "The desired bit length of the generated key (if key_type is equal to 'rsa')." + equal_to: [1024, 2048, 4096, 8192], default: 2048, + description: "The desired bit length of the generated key (if key_type is equal to 'rsa')." property :key_curve, String, - equal_to: %w{secp384r1 secp521r1 prime256v1}, default: "prime256v1", - description: "The desired curve of the generated key (if key_type is equal to 'ec'). Run openssl ecparam -list_curves to see available options." + equal_to: %w{secp384r1 secp521r1 prime256v1}, default: "prime256v1", + description: "The desired curve of the generated key (if key_type is equal to 'ec'). Run openssl ecparam -list_curves to see available options." default_action :create diff --git a/lib/chef/resource/osx_profile.rb b/lib/chef/resource/osx_profile.rb index 0641c66db9..eb5ba07f83 100644 --- a/lib/chef/resource/osx_profile.rb +++ b/lib/chef/resource/osx_profile.rb @@ -32,17 +32,17 @@ class Chef allowed_actions :install, :remove property :profile_name, String, - description: "Use to specify the name of the profile, if different from the name of the resource block.", - name_property: true, identity: true + description: "Use to specify the name of the profile, if different from the name of the resource block.", + name_property: true, identity: true property :profile, [ String, Hash ], - description: "Use to specify a profile. This may be the name of a profile contained in a cookbook or a Hash that contains the contents of the profile." + description: "Use to specify a profile. This may be the name of a profile contained in a cookbook or a Hash that contains the contents of the profile." property :identifier, String, - description: "Use to specify the identifier for the profile, such as com.company.screensaver." + description: "Use to specify the identifier for the profile, such as com.company.screensaver." property :path, String, - description: "The path to write the profile to disk before loading it." + description: "The path to write the profile to disk before loading it." end end end diff --git a/lib/chef/resource/package.rb b/lib/chef/resource/package.rb index 7f16dd0ce2..6f198c2b1f 100644 --- a/lib/chef/resource/package.rb +++ b/lib/chef/resource/package.rb @@ -42,23 +42,23 @@ class Chef end property :package_name, [ String, Array ], - description: "An optional property to set the package name if it differs from the resource block's name.", - identity: true + description: "An optional property to set the package name if it differs from the resource block's name.", + identity: true property :version, [ String, Array ], - description: "The version of a package to be installed or upgraded." + description: "The version of a package to be installed or upgraded." property :options, [ String, Array ], - description: "One (or more) additional command options that are passed to the command.", - coerce: proc { |x| x.is_a?(String) ? x.shellsplit : x } + description: "One (or more) additional command options that are passed to the command.", + coerce: proc { |x| x.is_a?(String) ? x.shellsplit : x } property :source, String, - description: "The optional path to a package on the local file system.", - desired_state: false + description: "The optional path to a package on the local file system.", + desired_state: false property :timeout, [ String, Integer ], - description: "The amount of time (in seconds) to wait before timing out.", - desired_state: false + description: "The amount of time (in seconds) to wait before timing out.", + desired_state: false end end diff --git a/lib/chef/resource/paludis_package.rb b/lib/chef/resource/paludis_package.rb index 88d4be6894..94b73ab570 100644 --- a/lib/chef/resource/paludis_package.rb +++ b/lib/chef/resource/paludis_package.rb @@ -31,8 +31,8 @@ class Chef allowed_actions :install, :remove, :upgrade property :timeout, Integer, - description: "The amount of time (in seconds) to wait before timing out.", - default: 3600 + description: "The amount of time (in seconds) to wait before timing out.", + default: 3600 end end end diff --git a/lib/chef/resource/powershell_package.rb b/lib/chef/resource/powershell_package.rb index 53be107ebc..ea8355d6f8 100644 --- a/lib/chef/resource/powershell_package.rb +++ b/lib/chef/resource/powershell_package.rb @@ -32,20 +32,20 @@ class Chef allowed_actions :install, :remove property :package_name, [String, Array], - description: "The name of the package. Default value: the name of the resource block.", - coerce: proc { |x| [x].flatten } + description: "The name of the package. Default value: the name of the resource block.", + coerce: proc { |x| [x].flatten } property :version, [String, Array], - description: "The version of a package to be installed or upgraded.", - coerce: proc { |x| [x].flatten } + description: "The version of a package to be installed or upgraded.", + coerce: proc { |x| [x].flatten } property :source, String, - description: "Specify the source of the package.", - introduced: "14.0" + description: "Specify the source of the package.", + introduced: "14.0" property :skip_publisher_check, [true, false], - description: "Skip validating module author.", - default: false, introduced: "14.3", desired_state: false + description: "Skip validating module author.", + default: false, introduced: "14.3", desired_state: false end end diff --git a/lib/chef/resource/powershell_package_source.rb b/lib/chef/resource/powershell_package_source.rb index 093c4c6835..5b3a6be049 100644 --- a/lib/chef/resource/powershell_package_source.rb +++ b/lib/chef/resource/powershell_package_source.rb @@ -27,31 +27,31 @@ class Chef introduced "14.3" property :source_name, String, - description: "The name of the package source.", - name_property: true + description: "The name of the package source.", + name_property: true property :url, String, - description: "The url to the package source.", - required: true + description: "The url to the package source.", + required: true property :trusted, [TrueClass, FalseClass], - description: "Whether or not to trust packages from this source.", - default: false + description: "Whether or not to trust packages from this source.", + default: false property :provider_name, String, - equal_to: %w{ Programs msi NuGet msu PowerShellGet psl chocolatey }, - validation_message: "The following providers are supported: 'Programs', 'msi', 'NuGet', 'msu', 'PowerShellGet', 'psl' or 'chocolatey'", - description: "The package management provider for the source. It supports the following providers: 'Programs', 'msi', 'NuGet', 'msu', 'PowerShellGet', 'psl' and 'chocolatey'.", - default: "NuGet" + equal_to: %w{ Programs msi NuGet msu PowerShellGet psl chocolatey }, + validation_message: "The following providers are supported: 'Programs', 'msi', 'NuGet', 'msu', 'PowerShellGet', 'psl' or 'chocolatey'", + description: "The package management provider for the source. It supports the following providers: 'Programs', 'msi', 'NuGet', 'msu', 'PowerShellGet', 'psl' and 'chocolatey'.", + default: "NuGet" property :publish_location, String, - description: "The url where modules will be published to for this source. Only valid if the provider is 'PowerShellGet'." + description: "The url where modules will be published to for this source. Only valid if the provider is 'PowerShellGet'." property :script_source_location, String, - description: "The url where scripts are located for this source. Only valid if the provider is 'PowerShellGet'." + description: "The url where scripts are located for this source. Only valid if the provider is 'PowerShellGet'." property :script_publish_location, String, - description: "The location where scripts will be published to for this source. Only valid if the provider is 'PowerShellGet'." + description: "The location where scripts will be published to for this source. Only valid if the provider is 'PowerShellGet'." load_current_value do cmd = load_resource_state_script(source_name) diff --git a/lib/chef/resource/reboot.rb b/lib/chef/resource/reboot.rb index f3f77780f9..bf3686ba47 100644 --- a/lib/chef/resource/reboot.rb +++ b/lib/chef/resource/reboot.rb @@ -36,12 +36,12 @@ class Chef default_action :nothing # make sure people are quite clear what they want property :reason, String, - description: "A string that describes the reboot action.", - default: "Reboot by #{Chef::Dist::PRODUCT}" + description: "A string that describes the reboot action.", + default: "Reboot by #{Chef::Dist::PRODUCT}" property :delay_mins, Integer, - description: "The amount of time (in minutes) to delay a reboot request.", - default: 0 + description: "The amount of time (in minutes) to delay a reboot request.", + default: 0 end end end diff --git a/lib/chef/resource/remote_directory.rb b/lib/chef/resource/remote_directory.rb index 50c183fbc5..70632b8be8 100644 --- a/lib/chef/resource/remote_directory.rb +++ b/lib/chef/resource/remote_directory.rb @@ -43,42 +43,42 @@ class Chef # This same property exists in the directory resource, but we need to change the default to true here. property :recursive, [ TrueClass, FalseClass ], - description: "Create or delete parent directories recursively. For the owner, group, and mode properties, the value of this attribute applies only to the leaf directory.", - default: true, desired_state: false + description: "Create or delete parent directories recursively. For the owner, group, and mode properties, the value of this attribute applies only to the leaf directory.", + default: true, desired_state: false property :source, String, - description: "The base name of the source file (and inferred from the path property).", - default_description: "The base portion of the 'path' property. For example '/some/path/' would be 'path'.", - default: lazy { ::File.basename(path) }, desired_state: false + description: "The base name of the source file (and inferred from the path property).", + default_description: "The base portion of the 'path' property. For example '/some/path/' would be 'path'.", + default: lazy { ::File.basename(path) }, desired_state: false property :files_backup, [ Integer, FalseClass ], - description: "The number of backup copies to keep for files in the directory.", - default: 5, desired_state: false + description: "The number of backup copies to keep for files in the directory.", + default: 5, desired_state: false property :purge, [ TrueClass, FalseClass ], - description: "Purge extra files found in the target directory.", - default: false, desired_state: false + description: "Purge extra files found in the target directory.", + default: false, desired_state: false property :overwrite, [ TrueClass, FalseClass ], - description: "Overwrite a file when it is different.", - default: true, desired_state: false + description: "Overwrite a file when it is different.", + default: true, desired_state: false property :cookbook, String, - description: "The cookbook in which a file is located (if it is not located in the current cookbook). The default value is the current cookbook.", - desired_state: false + description: "The cookbook in which a file is located (if it is not located in the current cookbook). The default value is the current cookbook.", + desired_state: false property :files_group, [String, Integer], - description: "Configure group permissions for files. A string or ID that identifies the group owner by group name, including fully qualified group names such as domain\\group or group@domain. If this value is not specified, existing groups remain unchanged and new group assignments use the default POSIX group (if available).", - regex: Chef::Config[:group_valid_regex] + description: "Configure group permissions for files. A string or ID that identifies the group owner by group name, including fully qualified group names such as domain\\group or group@domain. If this value is not specified, existing groups remain unchanged and new group assignments use the default POSIX group (if available).", + regex: Chef::Config[:group_valid_regex] property :files_mode, [String, Integer, nil], - description: "The octal mode for a file.\n UNIX- and Linux-based systems: A quoted 3-5 character string that defines the octal mode that is passed to chmod. For example: '755', '0755', or 00755. If the value is specified as a quoted string, it works exactly as if the chmod command was passed. If the value is specified as an integer, prepend a zero (0) to the value to ensure that it is interpreted as an octal number. For example, to assign read, write, and execute rights for all users, use '0777' or '777'; for the same rights, plus the sticky bit, use 01777 or '1777'.\n Microsoft Windows: A quoted 3-5 character string that defines the octal mode that is translated into rights for Microsoft Windows security. For example: '755', '0755', or 00755. Values up to '0777' are allowed (no sticky bits) and mean the same in Microsoft Windows as they do in UNIX, where 4 equals GENERIC_READ, 2 equals GENERIC_WRITE, and 1 equals GENERIC_EXECUTE. This property cannot be used to set :full_control. This property has no effect if not specified, but when it and rights are both specified, the effects are cumulative.", - default_description: "0644 on *nix systems", - regex: /^\d{3,4}$/, default: lazy { 0644 unless Chef::Platform.windows? } + description: "The octal mode for a file.\n UNIX- and Linux-based systems: A quoted 3-5 character string that defines the octal mode that is passed to chmod. For example: '755', '0755', or 00755. If the value is specified as a quoted string, it works exactly as if the chmod command was passed. If the value is specified as an integer, prepend a zero (0) to the value to ensure that it is interpreted as an octal number. For example, to assign read, write, and execute rights for all users, use '0777' or '777'; for the same rights, plus the sticky bit, use 01777 or '1777'.\n Microsoft Windows: A quoted 3-5 character string that defines the octal mode that is translated into rights for Microsoft Windows security. For example: '755', '0755', or 00755. Values up to '0777' are allowed (no sticky bits) and mean the same in Microsoft Windows as they do in UNIX, where 4 equals GENERIC_READ, 2 equals GENERIC_WRITE, and 1 equals GENERIC_EXECUTE. This property cannot be used to set :full_control. This property has no effect if not specified, but when it and rights are both specified, the effects are cumulative.", + default_description: "0644 on *nix systems", + regex: /^\d{3,4}$/, default: lazy { 0644 unless Chef::Platform.windows? } property :files_owner, [String, Integer], - description: "Configure owner permissions for files. A string or ID that identifies the group owner by user name, including fully qualified user names such as domain\\user or user@domain. If this value is not specified, existing owners remain unchanged and new owner assignments use the current user (when necessary).", - regex: Chef::Config[:user_valid_regex] + description: "Configure owner permissions for files. A string or ID that identifies the group owner by user name, including fully qualified user names such as domain\\user or user@domain. If this value is not specified, existing owners remain unchanged and new owner assignments use the current user (when necessary).", + regex: Chef::Config[:user_valid_regex] end end end diff --git a/lib/chef/resource/remote_file.rb b/lib/chef/resource/remote_file.rb index f3c45b0183..fae3e10695 100644 --- a/lib/chef/resource/remote_file.rb +++ b/lib/chef/resource/remote_file.rb @@ -47,10 +47,10 @@ class Chef def source(*args) arg = parse_source_args(args) ret = set_or_return(:source, - arg, - { callbacks: { - validate_source: method(:validate_source), - } }) + arg, + { callbacks: { + validate_source: method(:validate_source), + } }) if ret.is_a? String Array(ret) else diff --git a/lib/chef/resource/rhsm_errata.rb b/lib/chef/resource/rhsm_errata.rb index a13b9f98c7..7442bf99f2 100644 --- a/lib/chef/resource/rhsm_errata.rb +++ b/lib/chef/resource/rhsm_errata.rb @@ -29,8 +29,8 @@ class Chef introduced "14.0" property :errata_id, String, - description: "An optional property for specifying the errata ID if it differs from the resource block's name.", - name_property: true + description: "An optional property for specifying the errata ID if it differs from the resource block's name.", + name_property: true action :install do description "Installs a package for a specific errata ID." diff --git a/lib/chef/resource/rhsm_errata_level.rb b/lib/chef/resource/rhsm_errata_level.rb index 4ee254ad4a..2bb0006a38 100644 --- a/lib/chef/resource/rhsm_errata_level.rb +++ b/lib/chef/resource/rhsm_errata_level.rb @@ -27,10 +27,10 @@ class Chef introduced "14.0" property :errata_level, String, - coerce: proc { |x| x.downcase }, - equal_to: %w{critical moderate important low}, - description: "An optional property for specifying the errata level of packages to install if it differs from the resource block's name.", - name_property: true + coerce: proc { |x| x.downcase }, + equal_to: %w{critical moderate important low}, + description: "An optional property for specifying the errata level of packages to install if it differs from the resource block's name.", + name_property: true action :install do description "Install all packages of the specified errata level." diff --git a/lib/chef/resource/rhsm_register.rb b/lib/chef/resource/rhsm_register.rb index cca3d57f05..cfaa55124c 100644 --- a/lib/chef/resource/rhsm_register.rb +++ b/lib/chef/resource/rhsm_register.rb @@ -29,36 +29,36 @@ class Chef introduced "14.0" property :activation_key, [String, Array], - coerce: proc { |x| Array(x) }, - description: "A string or array of activation keys to use when registering; you must also specify the 'organization' property when using this property." + coerce: proc { |x| Array(x) }, + description: "A string or array of activation keys to use when registering; you must also specify the 'organization' property when using this property." property :satellite_host, String, - description: "The FQDN of the Satellite host to register with. If this property is not specified, the host will register with Red Hat's public RHSM service." + description: "The FQDN of the Satellite host to register with. If this property is not specified, the host will register with Red Hat's public RHSM service." property :organization, String, - description: "The organization to use when registering; required when using the 'activation_key' property." + description: "The organization to use when registering; required when using the 'activation_key' property." property :environment, String, - description: "The environment to use when registering; required when using the username and password properties." + description: "The environment to use when registering; required when using the username and password properties." property :username, String, - description: "The username to use when registering. This property is not applicable if using an activation key. If specified, password and environment properties are also required." + description: "The username to use when registering. This property is not applicable if using an activation key. If specified, password and environment properties are also required." property :password, String, - description: "The password to use when registering. This property is not applicable if using an activation key. If specified, username and environment are also required." + description: "The password to use when registering. This property is not applicable if using an activation key. If specified, username and environment are also required." property :auto_attach, - [TrueClass, FalseClass], - description: "If true, RHSM will attempt to automatically attach the host to applicable subscriptions. It is generally better to use an activation key with the subscriptions pre-defined.", - default: false + [TrueClass, FalseClass], + description: "If true, RHSM will attempt to automatically attach the host to applicable subscriptions. It is generally better to use an activation key with the subscriptions pre-defined.", + default: false property :install_katello_agent, [TrueClass, FalseClass], - description: "If true, the 'katello-agent' RPM will be installed.", - default: true + description: "If true, the 'katello-agent' RPM will be installed.", + default: true property :force, [TrueClass, FalseClass], - description: "If true, the system will be registered even if it is already registered. Normally, any register operations will fail if the machine has already been registered.", - default: false, desired_state: false + description: "If true, the system will be registered even if it is already registered. Normally, any register operations will fail if the machine has already been registered.", + default: false, desired_state: false action :register do description "Register the node with RHSM." diff --git a/lib/chef/resource/rhsm_repo.rb b/lib/chef/resource/rhsm_repo.rb index a7bddbeb95..feb2aa0802 100644 --- a/lib/chef/resource/rhsm_repo.rb +++ b/lib/chef/resource/rhsm_repo.rb @@ -28,8 +28,8 @@ class Chef introduced "14.0" property :repo_name, String, - description: "An optional property for specifying the repository name if it differs from the resource block's name.", - name_property: true + description: "An optional property for specifying the repository name if it differs from the resource block's name.", + name_property: true action :enable do description "Enable a RHSM repository." diff --git a/lib/chef/resource/rhsm_subscription.rb b/lib/chef/resource/rhsm_subscription.rb index 7b4864a905..7bbf53f07d 100644 --- a/lib/chef/resource/rhsm_subscription.rb +++ b/lib/chef/resource/rhsm_subscription.rb @@ -29,8 +29,8 @@ class Chef introduced "14.0" property :pool_id, String, - description: "An optional property for specifying the Pool ID if it differs from the resource block's name.", - name_property: true + description: "An optional property for specifying the Pool ID if it differs from the resource block's name.", + name_property: true action :attach do description "Attach the node to a subscription pool." diff --git a/lib/chef/resource/route.rb b/lib/chef/resource/route.rb index 64576bc651..42302afe6a 100644 --- a/lib/chef/resource/route.rb +++ b/lib/chef/resource/route.rb @@ -28,29 +28,29 @@ class Chef description "Use the route resource to manage the system routing table in a Linux environment." property :target, String, - description: "The IP address of the target route.", - identity: true, name_property: true + description: "The IP address of the target route.", + identity: true, name_property: true property :comment, [String, nil], - description: "Add a comment for the route.", - introduced: "14.0" + description: "Add a comment for the route.", + introduced: "14.0" property :metric, [Integer, nil], - description: "The route metric value." + description: "The route metric value." property :netmask, [String, nil], - description: "The decimal representation of the network mask. For example: 255.255.255.0." + description: "The decimal representation of the network mask. For example: 255.255.255.0." property :gateway, [String, nil], - description: "The gateway for the route." + description: "The gateway for the route." property :device, [String, nil], - description: "The network interface to which the route applies.", - desired_state: false # Has a partial default in the provider of eth0. + description: "The network interface to which the route applies.", + desired_state: false # Has a partial default in the provider of eth0. property :route_type, [Symbol, String], - description: "", - equal_to: [:host, :net], default: :host, desired_state: false + description: "", + equal_to: [:host, :net], default: :host, desired_state: false end end end diff --git a/lib/chef/resource/scm.rb b/lib/chef/resource/scm.rb index 473006140d..b62afb459d 100644 --- a/lib/chef/resource/scm.rb +++ b/lib/chef/resource/scm.rb @@ -25,49 +25,49 @@ class Chef allowed_actions :checkout, :export, :sync, :diff, :log property :destination, String, - description: "The location path to which the source is to be cloned, checked out, or exported. Default value: the name of the resource block.", - name_property: true, identity: true + description: "The location path to which the source is to be cloned, checked out, or exported. Default value: the name of the resource block.", + name_property: true, identity: true property :repository, String property :revision, String, - description: "The revision to checkout.", - default: "HEAD" + description: "The revision to checkout.", + default: "HEAD" property :user, [String, Integer], - description: "The system user that is responsible for the checked-out code." + description: "The system user that is responsible for the checked-out code." property :group, [String, Integer], - description: "The system group that is responsible for the checked-out code." + description: "The system group that is responsible for the checked-out code." # Capistrano and git-deploy use ``shallow clone'' property :depth, Integer, - description: "The number of past revisions to be included in the git shallow clone. Unless specified the default behavior will do a full clone." + description: "The number of past revisions to be included in the git shallow clone. Unless specified the default behavior will do a full clone." property :enable_submodules, [TrueClass, FalseClass], - description: "Perform a sub-module initialization and update.", - default: false + description: "Perform a sub-module initialization and update.", + default: false property :enable_checkout, [TrueClass, FalseClass], - description: "Check out a repo from master. Set to false when using the checkout_branch attribute to prevent the git resource from attempting to check out master from master.", - default: true + description: "Check out a repo from master. Set to false when using the checkout_branch attribute to prevent the git resource from attempting to check out master from master.", + default: true property :remote, String, - default: "origin" + default: "origin" property :ssh_wrapper, String, - desired_state: false + desired_state: false property :timeout, Integer, - desired_state: false + desired_state: false property :checkout_branch, String, - description: "Do a one-time checkout **or** use when a branch in the upstream repository is named 'deploy'. To prevent the resource from attempting to check out master from master, set 'enable_checkout' to 'false' when using the 'checkout_branch' property.", - default: "deploy" + description: "Do a one-time checkout **or** use when a branch in the upstream repository is named 'deploy'. To prevent the resource from attempting to check out master from master, set 'enable_checkout' to 'false' when using the 'checkout_branch' property.", + default: "deploy" property :environment, [Hash, nil], - description: "A Hash of environment variables in the form of ({'ENV_VARIABLE' => 'VALUE'}).", - default: nil + description: "A Hash of environment variables in the form of ({'ENV_VARIABLE' => 'VALUE'}).", + default: nil alias :env :environment end diff --git a/lib/chef/resource/service.rb b/lib/chef/resource/service.rb index 508ef8e643..f04e7b3c9c 100644 --- a/lib/chef/resource/service.rb +++ b/lib/chef/resource/service.rb @@ -31,7 +31,7 @@ class Chef default_action :nothing allowed_actions :enable, :disable, :start, :stop, :restart, :reload, - :mask, :unmask + :mask, :unmask # this is a poor API please do not re-use this pattern property :supports, Hash, default: { restart: nil, reload: nil, status: nil }, @@ -39,38 +39,38 @@ class Chef coerce: proc { |x| x.is_a?(Array) ? x.each_with_object({}) { |i, m| m[i] = true } : x } property :service_name, String, - description: "An optional property to set the service name if it differs from the resource block's name.", - name_property: true, identity: true + description: "An optional property to set the service name if it differs from the resource block's name.", + name_property: true, identity: true # regex for match against ps -ef when !supports[:has_status] && status == nil property :pattern, String, - description: "The pattern to look for in the process table.", - default_description: "The value provided to 'service_name' or the resource block's name", - default: lazy { service_name }, desired_state: false + description: "The pattern to look for in the process table.", + default_description: "The value provided to 'service_name' or the resource block's name", + default: lazy { service_name }, desired_state: false # command to call to start service property :start_command, [ String, nil, FalseClass ], - description: "The command used to start a service.", - desired_state: false + description: "The command used to start a service.", + desired_state: false # command to call to stop service property :stop_command, [ String, nil, FalseClass ], - description: "The command used to stop a service.", - desired_state: false + description: "The command used to stop a service.", + desired_state: false # command to call to get status of service property :status_command, [ String, nil, FalseClass ], - description: "The command used to check the run status for a service.", - desired_state: false + description: "The command used to check the run status for a service.", + desired_state: false # command to call to restart service property :restart_command, [ String, nil, FalseClass ], - description: "The command used to restart a service.", - desired_state: false + description: "The command used to restart a service.", + desired_state: false property :reload_command, [ String, nil, FalseClass ], - description: "The command used to tell a service to reload its configuration.", - desired_state: false + description: "The command used to tell a service to reload its configuration.", + desired_state: false # The path to the init script associated with the service. On many # distributions this is '/etc/init.d/SERVICE_NAME' by default. In @@ -78,8 +78,8 @@ class Chef # specify overrides for the start_command, stop_command and # restart_command properties. property :init_command, String, - description: "The path to the init script that is associated with the service. Use init_command to prevent the need to specify overrides for the start_command, stop_command, and restart_command properties. When this property is not specified, the #{Chef::Dist::CLIENT} will use the default init command for the service provider being used.", - desired_state: false + description: "The path to the init script that is associated with the service. Use init_command to prevent the need to specify overrides for the start_command, stop_command, and restart_command properties. When this property is not specified, the #{Chef::Dist::CLIENT} will use the default init command for the service provider being used.", + desired_state: false # if the service is enabled or not property :enabled, [ TrueClass, FalseClass ], skip_docs: true @@ -91,8 +91,8 @@ class Chef property :masked, [ TrueClass, FalseClass ], skip_docs: true property :options, [ Array, String ], - description: "Solaris platform only. Options to pass to the service command. See the svcadm manual for details of possible options.", - coerce: proc { |x| x.respond_to?(:split) ? x.shellsplit : x } + description: "Solaris platform only. Options to pass to the service command. See the svcadm manual for details of possible options.", + coerce: proc { |x| x.respond_to?(:split) ? x.shellsplit : x } # Priority arguments can have two forms: # @@ -105,22 +105,22 @@ class Chef # similar for other runlevels # property :priority, [ Integer, String, Hash ], - description: "Debian platform only. The relative priority of the program for start and shutdown ordering. May be an integer or a Hash. An integer is used to define the start run levels; stop run levels are then 100-integer. A Hash is used to define values for specific run levels. For example, { 2 => [:start, 20], 3 => [:stop, 55] } will set a priority of twenty for run level two and a priority of fifty-five for run level three." + description: "Debian platform only. The relative priority of the program for start and shutdown ordering. May be an integer or a Hash. An integer is used to define the start run levels; stop run levels are then 100-integer. A Hash is used to define values for specific run levels. For example, { 2 => [:start, 20], 3 => [:stop, 55] } will set a priority of twenty for run level two and a priority of fifty-five for run level three." # timeout only applies to the windows service manager property :timeout, Integer, - description: "Microsoft Windows platform only. The amount of time (in seconds) to wait before timing out.", - desired_state: false + description: "Microsoft Windows platform only. The amount of time (in seconds) to wait before timing out.", + desired_state: false property :parameters, Hash, - description: "Upstart only: A hash of parameters to pass to the service command for use in the service definition." + description: "Upstart only: A hash of parameters to pass to the service command for use in the service definition." property :run_levels, Array, - description: "RHEL platforms only: Specific run_levels the service will run under." + description: "RHEL platforms only: Specific run_levels the service will run under." property :user, String, - description: "systemd only: A username to run the service under.", - introduced: "12.21" + description: "systemd only: A username to run the service under.", + introduced: "12.21" end end end diff --git a/lib/chef/resource/snap_package.rb b/lib/chef/resource/snap_package.rb index a8be77d5ce..8fb6b61c2c 100644 --- a/lib/chef/resource/snap_package.rb +++ b/lib/chef/resource/snap_package.rb @@ -27,10 +27,10 @@ class Chef introduced "15.0" property :channel, String, - description: "The default channel. For example: stable.", - default: "stable", - equal_to: %w{edge beta candidate stable}, - desired_state: false + description: "The default channel. For example: stable.", + default: "stable", + equal_to: %w{edge beta candidate stable}, + desired_state: false end end end diff --git a/lib/chef/resource/ssh_known_hosts_entry.rb b/lib/chef/resource/ssh_known_hosts_entry.rb index bf36560c51..b0fb926550 100644 --- a/lib/chef/resource/ssh_known_hosts_entry.rb +++ b/lib/chef/resource/ssh_known_hosts_entry.rb @@ -29,43 +29,43 @@ class Chef introduced "14.3" property :host, String, - description: "The host to add to the known hosts file.", - name_property: true + description: "The host to add to the known hosts file.", + name_property: true property :key, String, - description: "An optional key for the host. If not provided this will be automatically determined." + description: "An optional key for the host. If not provided this will be automatically determined." property :key_type, String, - description: "The type of key to store.", - default: "rsa" + description: "The type of key to store.", + default: "rsa" property :port, Integer, - description: "The server port that the ssh-keyscan command will use to gather the public key.", - default: 22 + description: "The server port that the ssh-keyscan command will use to gather the public key.", + default: 22 property :timeout, Integer, - description: "The timeout in seconds for ssh-keyscan.", - default: 30 + description: "The timeout in seconds for ssh-keyscan.", + default: 30 property :mode, String, - description: "The file mode for the ssh_known_hosts file.", - default: "0644" + description: "The file mode for the ssh_known_hosts file.", + default: "0644" property :owner, [String, Integer], - description: "The file owner for the ssh_known_hosts file.", - default: "root" + description: "The file owner for the ssh_known_hosts file.", + default: "root" property :group, [String, Integer], - description: "The file group for the ssh_known_hosts file.", - default: lazy { node["root_group"] } + description: "The file group for the ssh_known_hosts file.", + default: lazy { node["root_group"] } property :hash_entries, [TrueClass, FalseClass], - description: "Hash the hostname and addresses in the ssh_known_hosts file for privacy.", - default: false + description: "Hash the hostname and addresses in the ssh_known_hosts file for privacy.", + default: false property :file_location, String, - description: "The location of the ssh known hosts file. Change this to set a known host file for a particular user.", - default: "/etc/ssh/ssh_known_hosts" + description: "The location of the ssh known hosts file. Change this to set a known host file for a particular user.", + default: "/etc/ssh/ssh_known_hosts" action :create do description "Create an entry in the ssh_known_hosts file." diff --git a/lib/chef/resource/subversion.rb b/lib/chef/resource/subversion.rb index c60f03710f..e7ded4fa54 100644 --- a/lib/chef/resource/subversion.rb +++ b/lib/chef/resource/subversion.rb @@ -28,24 +28,24 @@ class Chef allowed_actions :force_export property :svn_arguments, [String, nil, FalseClass], - description: "The extra arguments that are passed to the Subversion command.", - coerce: proc { |v| v == false ? nil : v }, # coerce false to nil - default: "--no-auth-cache" + description: "The extra arguments that are passed to the Subversion command.", + coerce: proc { |v| v == false ? nil : v }, # coerce false to nil + default: "--no-auth-cache" property :svn_info_args, [String, nil, FalseClass], - description: "Use when the svn info command is used by the #{Chef::Dist::CLIENT} and arguments need to be passed. The svn_arguments command does not work when the svn info command is used.", - coerce: proc { |v| v == false ? nil : v }, # coerce false to nil - default: "--no-auth-cache" + description: "Use when the svn info command is used by the #{Chef::Dist::CLIENT} and arguments need to be passed. The svn_arguments command does not work when the svn info command is used.", + coerce: proc { |v| v == false ? nil : v }, # coerce false to nil + default: "--no-auth-cache" property :svn_binary, String, - description: "The location of the svn binary." + description: "The location of the svn binary." property :svn_username, String, - description: "The username to use for interacting with subversion." + description: "The username to use for interacting with subversion." property :svn_password, String, - description: "The password to use for interacting with subversion.", - sensitive: true, desired_state: false + description: "The password to use for interacting with subversion.", + sensitive: true, desired_state: false # Override exception to strip password if any, so it won't appear in logs and different Chef notifications def custom_exception_message(e) diff --git a/lib/chef/resource/sudo.rb b/lib/chef/resource/sudo.rb index 1159295ed4..7dbae2623c 100644 --- a/lib/chef/resource/sudo.rb +++ b/lib/chef/resource/sudo.rb @@ -37,77 +37,77 @@ class Chef # acording to the sudo man pages sudo will ignore files in an include dir that have a `.` or `~` # We convert either to `__` property :filename, String, - description: "The name of the sudoers.d file if it differs from the name of the resource block", - name_property: true, - coerce: proc { |x| x.gsub(/[\.~]/, "__") } + description: "The name of the sudoers.d file if it differs from the name of the resource block", + name_property: true, + coerce: proc { |x| x.gsub(/[\.~]/, "__") } property :users, [String, Array], - description: "User(s) to provide sudo privileges to. This property accepts either an array or a comma separated list.", - default: lazy { [] }, - coerce: proc { |x| x.is_a?(Array) ? x : x.split(/\s*,\s*/) } + description: "User(s) to provide sudo privileges to. This property accepts either an array or a comma separated list.", + default: lazy { [] }, + coerce: proc { |x| x.is_a?(Array) ? x : x.split(/\s*,\s*/) } property :groups, [String, Array], - description: "Group(s) to provide sudo privileges to. This property accepts either an array or a comma separated list. Leading % on group names is optional.", - default: lazy { [] }, - coerce: proc { |x| coerce_groups(x) } + description: "Group(s) to provide sudo privileges to. This property accepts either an array or a comma separated list. Leading % on group names is optional.", + default: lazy { [] }, + coerce: proc { |x| coerce_groups(x) } property :commands, Array, - description: "An array of commands this sudoer can execute.", - default: ["ALL"] + description: "An array of commands this sudoer can execute.", + default: ["ALL"] property :host, String, - description: "The host to set in the sudo configuration.", - default: "ALL" + description: "The host to set in the sudo configuration.", + default: "ALL" property :runas, String, - description: "User that the command(s) can be run as.", - default: "ALL" + description: "User that the command(s) can be run as.", + default: "ALL" property :nopasswd, [TrueClass, FalseClass], - description: "Allow sudo to be run without specifying a password.", - default: false + description: "Allow sudo to be run without specifying a password.", + default: false property :noexec, [TrueClass, FalseClass], - description: "Prevent commands from shelling out.", - default: false + description: "Prevent commands from shelling out.", + default: false property :template, String, - description: "The name of the erb template in your cookbook, if you wish to supply your own template." + description: "The name of the erb template in your cookbook, if you wish to supply your own template." property :variables, [Hash, nil], - description: "The variables to pass to the custom template. This property is ignored if not using a custom template.", - default: nil + description: "The variables to pass to the custom template. This property is ignored if not using a custom template.", + default: nil property :defaults, Array, - description: "An array of defaults for the user/group.", - default: lazy { [] } + description: "An array of defaults for the user/group.", + default: lazy { [] } property :command_aliases, Array, - description: "Command aliases that can be used as allowed commands later in the configuration.", - default: lazy { [] } + description: "Command aliases that can be used as allowed commands later in the configuration.", + default: lazy { [] } property :setenv, [TrueClass, FalseClass], - description: "Determines whether or not to permit preservation of the environment with 'sudo -E'.", - default: false + description: "Determines whether or not to permit preservation of the environment with 'sudo -E'.", + default: false property :env_keep_add, Array, - description: "An array of strings to add to env_keep.", - default: lazy { [] } + description: "An array of strings to add to env_keep.", + default: lazy { [] } property :env_keep_subtract, Array, - description: "An array of strings to remove from env_keep.", - default: lazy { [] } + description: "An array of strings to remove from env_keep.", + default: lazy { [] } property :visudo_path, String, - deprecated: true + deprecated: true property :visudo_binary, String, - description: "The path to visudo for configuration verification.", - default: "/usr/sbin/visudo" + description: "The path to visudo for configuration verification.", + default: "/usr/sbin/visudo" property :config_prefix, String, - description: "The directory that contains the sudoers configuration file.", - default: lazy { platform_config_prefix }, default_description: "Prefix values based on the node's platform" + description: "The directory that contains the sudoers configuration file.", + default: lazy { platform_config_prefix }, default_description: "Prefix values based on the node's platform" # handle legacy cookbook property def after_created diff --git a/lib/chef/resource/swap_file.rb b/lib/chef/resource/swap_file.rb index 0319676f34..4a5629d824 100644 --- a/lib/chef/resource/swap_file.rb +++ b/lib/chef/resource/swap_file.rb @@ -27,22 +27,22 @@ class Chef introduced "14.0" property :path, String, - description: "The path where the swap file will be created on the system if it differs from the resource block's name.", - name_property: true + description: "The path where the swap file will be created on the system if it differs from the resource block's name.", + name_property: true property :size, Integer, - description: "The size (in MBs) of the swap file." + description: "The size (in MBs) of the swap file." property :persist, [TrueClass, FalseClass], - description: "Persist the swapon.", - default: false + description: "Persist the swapon.", + default: false property :timeout, Integer, - description: "Timeout for 'dd' / 'fallocate' commands.", - default: 600 + description: "Timeout for 'dd' / 'fallocate' commands.", + default: 600 property :swappiness, Integer, - description: "The swappiness value to set on the system." + description: "The swappiness value to set on the system." action :create do description "Create a swapfile." diff --git a/lib/chef/resource/sysctl.rb b/lib/chef/resource/sysctl.rb index 9d0c20fe6b..2986c4e914 100644 --- a/lib/chef/resource/sysctl.rb +++ b/lib/chef/resource/sysctl.rb @@ -33,21 +33,21 @@ class Chef introduced "14.0" property :key, String, - description: "The kernel parameter key in dotted format if it differs from the resource block's name.", - name_property: true + description: "The kernel parameter key in dotted format if it differs from the resource block's name.", + name_property: true property :ignore_error, [TrueClass, FalseClass], - description: "Ignore any errors when setting the value on the command line.", - default: false, desired_state: false + description: "Ignore any errors when setting the value on the command line.", + default: false, desired_state: false property :value, [Array, String, Integer, Float], - description: "The value to set.", - coerce: proc { |v| coerce_value(v) }, - required: true + description: "The value to set.", + coerce: proc { |v| coerce_value(v) }, + required: true property :conf_dir, String, - description: "The configuration directory to write the config to.", - default: "/etc/sysctl.d" + description: "The configuration directory to write the config to.", + default: "/etc/sysctl.d" def after_created raise "The sysctl resource requires Linux as it needs sysctl and the sysctl.d directory functionality." unless node["os"] == "linux" diff --git a/lib/chef/resource/systemd_unit.rb b/lib/chef/resource/systemd_unit.rb index b64a22af47..973fdf9491 100644 --- a/lib/chef/resource/systemd_unit.rb +++ b/lib/chef/resource/systemd_unit.rb @@ -30,13 +30,13 @@ class Chef default_action :nothing allowed_actions :create, :delete, - :preset, :revert, - :enable, :disable, :reenable, - :mask, :unmask, - :start, :stop, - :restart, :reload, - :try_restart, :reload_or_restart, - :reload_or_try_restart + :preset, :revert, + :enable, :disable, :reenable, + :mask, :unmask, + :start, :stop, + :restart, :reload, + :try_restart, :reload_or_restart, + :reload_or_try_restart # Internal provider-managed properties property :enabled, [TrueClass, FalseClass], skip_docs: true @@ -49,15 +49,15 @@ class Chef description: "The user account that the systemd unit process is run under. The path to the unit for that user would be something like '/etc/systemd/user/sshd.service'. If no user account is specified, the systemd unit will run under a 'system' account, with the path to the unit being something like '/etc/systemd/system/sshd.service'." property :content, [String, Hash], - description: "A string or hash that contains a systemd `unit file <https://www.freedesktop.org/software/systemd/man/systemd.unit.html>`_ definition that describes the properties of systemd-managed entities, such as services, sockets, devices, and so on. In #{Chef::Dist::PRODUCT} 14.4 or later, repeatable options can be implemented with an array." + description: "A string or hash that contains a systemd `unit file <https://www.freedesktop.org/software/systemd/man/systemd.unit.html>`_ definition that describes the properties of systemd-managed entities, such as services, sockets, devices, and so on. In #{Chef::Dist::PRODUCT} 14.4 or later, repeatable options can be implemented with an array." property :triggers_reload, [TrueClass, FalseClass], - description: "Specifies whether to trigger a daemon reload when creating or deleting a unit.", - default: true, desired_state: false + description: "Specifies whether to trigger a daemon reload when creating or deleting a unit.", + default: true, desired_state: false property :verify, [TrueClass, FalseClass], - default: true, desired_state: false, - description: "Specifies if the unit will be verified before installation. Systemd can be overly strict when verifying units, so in certain cases it is preferable not to verify the unit." + default: true, desired_state: false, + description: "Specifies if the unit will be verified before installation. Systemd can be overly strict when verifying units, so in certain cases it is preferable not to verify the unit." property :unit_name, String, desired_state: false, identity: true, name_property: true, diff --git a/lib/chef/resource/template.rb b/lib/chef/resource/template.rb index 7ca22f5b63..27002c4a03 100644 --- a/lib/chef/resource/template.rb +++ b/lib/chef/resource/template.rb @@ -59,16 +59,16 @@ class Chef end property :variables, Hash, - description: "The variables property of the template resource can be used to reference a partial template file by using a Hash.", - default: lazy { Hash.new } + description: "The variables property of the template resource can be used to reference a partial template file by using a Hash.", + default: lazy { Hash.new } property :cookbook, String, - description: "The cookbook in which a file is located (if it is not located in the current cookbook). The default value is the current cookbook.", - desired_state: false + description: "The cookbook in which a file is located (if it is not located in the current cookbook). The default value is the current cookbook.", + desired_state: false property :local, [ TrueClass, FalseClass ], - default: false, desired_state: false, - description: "Load a template from a local path. By default, the #{Chef::Dist::CLIENT} loads templates from a cookbook’s /templates directory. When this property is set to true, use the source property to specify the path to a template on the local node." + default: false, desired_state: false, + description: "Load a template from a local path. By default, the #{Chef::Dist::CLIENT} loads templates from a cookbook’s /templates directory. When this property is set to true, use the source property to specify the path to a template on the local node." # Declares a helper method to be defined in the template context when # rendering. diff --git a/lib/chef/resource/timezone.rb b/lib/chef/resource/timezone.rb index 6a3d2e5520..0f5cf7cb0c 100644 --- a/lib/chef/resource/timezone.rb +++ b/lib/chef/resource/timezone.rb @@ -28,8 +28,8 @@ class Chef introduced "14.6" property :timezone, String, - description: "An optional property to set the timezone value if it differs from the resource block's name.", - name_property: true + description: "An optional property to set the timezone value if it differs from the resource block's name.", + name_property: true action :set do description "Set the timezone." diff --git a/lib/chef/resource/user.rb b/lib/chef/resource/user.rb index 40d44c848f..19ae2d8dc8 100644 --- a/lib/chef/resource/user.rb +++ b/lib/chef/resource/user.rb @@ -29,47 +29,47 @@ class Chef allowed_actions :create, :remove, :modify, :manage, :lock, :unlock property :username, String, - description: "An optional property to set the username value if it differs from the resource block's name.", - name_property: true, identity: true + description: "An optional property to set the username value if it differs from the resource block's name.", + name_property: true, identity: true property :comment, String, - description: "The contents of the user comments field." + description: "The contents of the user comments field." property :home, String, - description: "The location of the home directory." + description: "The location of the home directory." property :salt, String, - description: "A SALTED-SHA512-PBKDF2 hash.", - desired_state: false + description: "A SALTED-SHA512-PBKDF2 hash.", + desired_state: false property :shell, String, - description: "The login shell." + description: "The login shell." property :password, String, - description: "The password shadow hash", - desired_state: false + description: "The password shadow hash", + desired_state: false property :non_unique, [ TrueClass, FalseClass ], - description: "Create a duplicate (non-unique) user account.", - default: false, desired_state: false + description: "Create a duplicate (non-unique) user account.", + default: false, desired_state: false property :manage_home, [ TrueClass, FalseClass ], - description: "Manage a user’s home directory.\nWhen used with the :create action, a user’s home directory is created based on HOME_DIR. If the home directory is missing, it is created unless CREATE_HOME in /etc/login.defs is set to no. When created, a skeleton set of files and subdirectories are included within the home directory.\nWhen used with the :modify action, a user’s home directory is moved to HOME_DIR. If the home directory is missing, it is created unless CREATE_HOME in /etc/login.defs is set to no. The contents of the user’s home directory are moved to the new location.", - default: false, desired_state: false + description: "Manage a user’s home directory.\nWhen used with the :create action, a user’s home directory is created based on HOME_DIR. If the home directory is missing, it is created unless CREATE_HOME in /etc/login.defs is set to no. When created, a skeleton set of files and subdirectories are included within the home directory.\nWhen used with the :modify action, a user’s home directory is moved to HOME_DIR. If the home directory is missing, it is created unless CREATE_HOME in /etc/login.defs is set to no. The contents of the user’s home directory are moved to the new location.", + default: false, desired_state: false property :force, [ TrueClass, FalseClass ], - description: "Force the removal of a user. May be used only with the :remove action.", - default: false, desired_state: false + description: "Force the removal of a user. May be used only with the :remove action.", + default: false, desired_state: false property :system, [ TrueClass, FalseClass ], - description: "Create a system user. This property may be used with useradd as the provider to create a system user which passes the -r flag to useradd.", - default: false + description: "Create a system user. This property may be used with useradd as the provider to create a system user which passes the -r flag to useradd.", + default: false property :uid, [ String, Integer, NilClass ], # nil for backwards compat - description: "The numeric user identifier." + description: "The numeric user identifier." property :gid, [ String, Integer, NilClass ], # nil for backwards compat - description: "The numeric group identifier." + description: "The numeric group identifier." alias_method :group, :gid end diff --git a/lib/chef/resource/user/dscl_user.rb b/lib/chef/resource/user/dscl_user.rb index 546a385204..54d78d20a0 100644 --- a/lib/chef/resource/user/dscl_user.rb +++ b/lib/chef/resource/user/dscl_user.rb @@ -27,8 +27,8 @@ class Chef provides :user, os: "darwin" property :iterations, Integer, - description: "macOS platform only. The number of iterations for a password with a SALTED-SHA512-PBKDF2 shadow hash.", - default: 27855, desired_state: false + description: "macOS platform only. The number of iterations for a password with a SALTED-SHA512-PBKDF2 shadow hash.", + default: 27855, desired_state: false end end end diff --git a/lib/chef/resource/user/windows_user.rb b/lib/chef/resource/user/windows_user.rb index 4173ac78ba..2993887890 100644 --- a/lib/chef/resource/user/windows_user.rb +++ b/lib/chef/resource/user/windows_user.rb @@ -27,8 +27,8 @@ class Chef provides :user, os: "windows" property :full_name, String, - description: "The full name of the user.", - introduced: "14.6" + description: "The full name of the user.", + introduced: "14.6" end end end diff --git a/lib/chef/resource/windows_ad_join.rb b/lib/chef/resource/windows_ad_join.rb index a7f205841c..fd08f9149a 100644 --- a/lib/chef/resource/windows_ad_join.rb +++ b/lib/chef/resource/windows_ad_join.rb @@ -31,35 +31,35 @@ class Chef introduced "14.0" property :domain_name, String, - description: "The FQDN of the Active Directory domain to join if it differs from the resource block's name.", - validation_message: "The 'domain_name' property must be a FQDN.", - regex: /.\../, # anything.anything - name_property: true + description: "The FQDN of the Active Directory domain to join if it differs from the resource block's name.", + validation_message: "The 'domain_name' property must be a FQDN.", + regex: /.\../, # anything.anything + name_property: true property :domain_user, String, - description: "The domain user that will be used to join the domain.", - required: true + description: "The domain user that will be used to join the domain.", + required: true property :domain_password, String, - description: "The password for the domain user. Note that this resource is set to hide sensitive information by default. ", - required: true + description: "The password for the domain user. Note that this resource is set to hide sensitive information by default. ", + required: true property :ou_path, String, - description: "The path to the Organizational Unit where the host will be placed." + description: "The path to the Organizational Unit where the host will be placed." property :reboot, Symbol, - equal_to: [:immediate, :delayed, :never, :request_reboot, :reboot_now], - validation_message: "The reboot property accepts :immediate (reboot as soon as the resource completes), :delayed (reboot once the #{Chef::Dist::PRODUCT} run completes), and :never (Don't reboot)", - description: "Controls the system reboot behavior post domain joining. Reboot immediately, after the #{Chef::Dist::PRODUCT} run completes, or never. Note that a reboot is necessary for changes to take effect.", - default: :immediate + equal_to: [:immediate, :delayed, :never, :request_reboot, :reboot_now], + validation_message: "The reboot property accepts :immediate (reboot as soon as the resource completes), :delayed (reboot once the #{Chef::Dist::PRODUCT} run completes), and :never (Don't reboot)", + description: "Controls the system reboot behavior post domain joining. Reboot immediately, after the #{Chef::Dist::PRODUCT} run completes, or never. Note that a reboot is necessary for changes to take effect.", + default: :immediate property :new_hostname, String, - description: "Specifies a new hostname for the computer in the new domain.", - introduced: "14.5" + description: "Specifies a new hostname for the computer in the new domain.", + introduced: "14.5" # define this again so we can default it to true. Otherwise failures print the password property :sensitive, [TrueClass, FalseClass], - default: true, desired_state: false + default: true, desired_state: false action :join do description "Join the Active Directory domain." diff --git a/lib/chef/resource/windows_auto_run.rb b/lib/chef/resource/windows_auto_run.rb index c349529e6c..c0d0910e5f 100644 --- a/lib/chef/resource/windows_auto_run.rb +++ b/lib/chef/resource/windows_auto_run.rb @@ -28,20 +28,20 @@ class Chef introduced "14.0" property :program_name, String, - description: "The name of the program to run at login if it differs from the resource block's name.", - name_property: true + description: "The name of the program to run at login if it differs from the resource block's name.", + name_property: true property :path, String, - coerce: proc { |x| x.tr("/", "\\") }, # make sure we have windows paths for the registry - description: "The path to the program that will run at login. " + coerce: proc { |x| x.tr("/", "\\") }, # make sure we have windows paths for the registry + description: "The path to the program that will run at login. " property :args, String, - description: "Any arguments to be used with the program." + description: "Any arguments to be used with the program." property :root, Symbol, - description: "The registry root key to put the entry under.", - equal_to: %i{machine user}, - default: :machine + description: "The registry root key to put the entry under.", + equal_to: %i{machine user}, + default: :machine alias_method :program, :path diff --git a/lib/chef/resource/windows_certificate.rb b/lib/chef/resource/windows_certificate.rb index 456543a4a6..fa76d7273d 100644 --- a/lib/chef/resource/windows_certificate.rb +++ b/lib/chef/resource/windows_certificate.rb @@ -32,30 +32,30 @@ class Chef introduced "14.7" property :source, String, - description: "The source file (for create and acl_add), thumbprint (for delete and acl_add) or subject (for delete) if it differs from the resource block's name.", - name_property: true + description: "The source file (for create and acl_add), thumbprint (for delete and acl_add) or subject (for delete) if it differs from the resource block's name.", + name_property: true property :pfx_password, String, - description: "The password to access the source if it is a pfx file." + description: "The password to access the source if it is a pfx file." property :private_key_acl, Array, - description: "An array of 'domain\account' entries to be granted read-only access to the certificate's private key. Not idempotent." + description: "An array of 'domain\account' entries to be granted read-only access to the certificate's private key. Not idempotent." property :store_name, String, - description: "The certificate store to manipulate.", - default: "MY", equal_to: ["TRUSTEDPUBLISHER", "TrustedPublisher", "CLIENTAUTHISSUER", "REMOTE DESKTOP", "ROOT", "TRUSTEDDEVICES", "WEBHOSTING", "CA", "AUTHROOT", "TRUSTEDPEOPLE", "MY", "SMARTCARDROOT", "TRUST", "DISALLOWED"] + description: "The certificate store to manipulate.", + default: "MY", equal_to: ["TRUSTEDPUBLISHER", "TrustedPublisher", "CLIENTAUTHISSUER", "REMOTE DESKTOP", "ROOT", "TRUSTEDDEVICES", "WEBHOSTING", "CA", "AUTHROOT", "TRUSTEDPEOPLE", "MY", "SMARTCARDROOT", "TRUST", "DISALLOWED"] property :user_store, [TrueClass, FalseClass], - description: "Use the user store of the local machine store if set to false.", - default: false + description: "Use the user store of the local machine store if set to false.", + default: false property :cert_path, String, - description: "" + description: "" # lazy used to set default value of sensitive to true if password is set property :sensitive, [TrueClass, FalseClass], - description: "Ensure that sensitive resource data is not logged by the #{Chef::Dist::CLIENT}.", - default: lazy { |r| r.pfx_password ? true : false }, skip_docs: true + description: "Ensure that sensitive resource data is not logged by the #{Chef::Dist::CLIENT}.", + default: lazy { |r| r.pfx_password ? true : false }, skip_docs: true action :create do description "Creates or updates a certificate." diff --git a/lib/chef/resource/windows_dfs_folder.rb b/lib/chef/resource/windows_dfs_folder.rb index a93a11808c..763163eb90 100644 --- a/lib/chef/resource/windows_dfs_folder.rb +++ b/lib/chef/resource/windows_dfs_folder.rb @@ -28,18 +28,18 @@ class Chef introduced "15.0" property :folder_path, String, - description: "An optional property to set the path of the dfs folder if it differs from the resource block's name.", - name_property: true + description: "An optional property to set the path of the dfs folder if it differs from the resource block's name.", + name_property: true property :namespace_name, String, - description: "The namespace this should be created within.", - required: true + description: "The namespace this should be created within.", + required: true property :target_path, String, - description: "The target that this path will connect you to." + description: "The target that this path will connect you to." property :description, String, - description: "Description for the share." + description: "Description for the share." action :create do description "Creates the folder in dfs namespace." diff --git a/lib/chef/resource/windows_dfs_namespace.rb b/lib/chef/resource/windows_dfs_namespace.rb index 2610b7a999..34ac58ff2e 100644 --- a/lib/chef/resource/windows_dfs_namespace.rb +++ b/lib/chef/resource/windows_dfs_namespace.rb @@ -28,28 +28,28 @@ class Chef introduced "15.0" property :namespace_name, String, - description: "An optional property to set the dfs namespace if it differs from the resource block's name.", - name_property: true + description: "An optional property to set the dfs namespace if it differs from the resource block's name.", + name_property: true property :description, String, - description: "Description of the share.", - required: true + description: "Description of the share.", + required: true property :full_users, Array, - description: "Determines which users should have full access to the share.", - default: ['BUILTIN\\administrators'] + description: "Determines which users should have full access to the share.", + default: ['BUILTIN\\administrators'] property :change_users, Array, - description: "Determines which users should have change access to the share.", - default: [] + description: "Determines which users should have change access to the share.", + default: [] property :read_users, Array, - description: "Determines which users should have read access to the share.", - default: [] + description: "Determines which users should have read access to the share.", + default: [] property :root, String, - description: "The root from which to create the DFS tree. Defaults to C:\\DFSRoots.", - default: 'C:\\DFSRoots' + description: "The root from which to create the DFS tree. Defaults to C:\\DFSRoots.", + default: 'C:\\DFSRoots' action :create do description "Creates the dfs namespace on the server." diff --git a/lib/chef/resource/windows_dfs_server.rb b/lib/chef/resource/windows_dfs_server.rb index 56a6af460e..cfcf20ec59 100644 --- a/lib/chef/resource/windows_dfs_server.rb +++ b/lib/chef/resource/windows_dfs_server.rb @@ -28,24 +28,24 @@ class Chef introduced "15.0" property :use_fqdn, [TrueClass, FalseClass], - description: "Indicates whether a DFS namespace server uses FQDNs in referrals. If this parameter has a value of true, the server uses FQDNs in referrals. If this parameter has a value of false, the server uses NetBIOS names.", - default: false + description: "Indicates whether a DFS namespace server uses FQDNs in referrals. If this parameter has a value of true, the server uses FQDNs in referrals. If this parameter has a value of false, the server uses NetBIOS names.", + default: false property :ldap_timeout_secs, Integer, - description: "", - default: 30 + description: "", + default: 30 property :prefer_login_dc, [TrueClass, FalseClass], - description: "", - default: false + description: "", + default: false property :enable_site_costed_referrals, [TrueClass, FalseClass], - description: "", - default: false + description: "", + default: false property :sync_interval_secs, Integer, - description: "", - default: 3600 + description: "", + default: 3600 load_current_value do ps_results = powershell_out("Get-DfsnServerConfiguration -ComputerName '#{ENV['COMPUTERNAME']}' | Select LdapTimeoutSec, PreferLogonDC, EnableSiteCostedReferrals, SyncIntervalSec, UseFqdn | ConvertTo-Json") diff --git a/lib/chef/resource/windows_dns_record.rb b/lib/chef/resource/windows_dns_record.rb index 179b0f0bf5..701656b34a 100644 --- a/lib/chef/resource/windows_dns_record.rb +++ b/lib/chef/resource/windows_dns_record.rb @@ -28,20 +28,20 @@ class Chef introduced "15.0" property :record_name, String, - description: "An optional property to set the dns record name if it differs from the resource block's name.", - name_property: true + description: "An optional property to set the dns record name if it differs from the resource block's name.", + name_property: true property :zone, String, - description: "The zone to create the record in.", - required: true + description: "The zone to create the record in.", + required: true property :target, String, - description: "The target for the record.", - required: true + description: "The target for the record.", + required: true property :record_type, String, - description: "The type of record to create, can be either ARecord, CNAME or PTR.", - default: "ARecord", equal_to: %w{ARecord CNAME PTR} + description: "The type of record to create, can be either ARecord, CNAME or PTR.", + default: "ARecord", equal_to: %w{ARecord CNAME PTR} action :create do description "Creates and updates the DNS entry." diff --git a/lib/chef/resource/windows_dns_zone.rb b/lib/chef/resource/windows_dns_zone.rb index b3ae4b9ff7..9ac208fddc 100644 --- a/lib/chef/resource/windows_dns_zone.rb +++ b/lib/chef/resource/windows_dns_zone.rb @@ -28,16 +28,16 @@ class Chef introduced "15.0" property :zone_name, String, - description: "An optional property to set the dns zone name if it differs from the resource block's name.", - name_property: true + description: "An optional property to set the dns zone name if it differs from the resource block's name.", + name_property: true property :replication_scope, String, - description: "The replication scope for the zone, required if server_type set to 'Domain'.", - default: "Domain" + description: "The replication scope for the zone, required if server_type set to 'Domain'.", + default: "Domain" property :server_type, String, - description: "The type of DNS server, Domain or Standalone.", - default: "Domain", equal_to: %w{Domain Standalone} + description: "The type of DNS server, Domain or Standalone.", + default: "Domain", equal_to: %w{Domain Standalone} action :create do description "Creates and updates a DNS Zone." diff --git a/lib/chef/resource/windows_env.rb b/lib/chef/resource/windows_env.rb index 9428ef7d79..27bdbb74a8 100644 --- a/lib/chef/resource/windows_env.rb +++ b/lib/chef/resource/windows_env.rb @@ -32,16 +32,16 @@ class Chef allowed_actions :create, :delete, :modify property :key_name, String, - description: "An optional property to set the name of the key that is to be created, deleted, or modified if it differs from the resource block's name.", - identity: true, name_property: true + description: "An optional property to set the name of the key that is to be created, deleted, or modified if it differs from the resource block's name.", + identity: true, name_property: true property :value, String, - description: "The value of the environmental variable to set.", - required: true + description: "The value of the environmental variable to set.", + required: true property :delim, [ String, nil, false ], - description: "The delimiter that is used to separate multiple values for a single key.", - desired_state: false + description: "The delimiter that is used to separate multiple values for a single key.", + desired_state: false property :user, String, default: "<System>" end diff --git a/lib/chef/resource/windows_feature.rb b/lib/chef/resource/windows_feature.rb index cb8fb231c1..e937c6f990 100644 --- a/lib/chef/resource/windows_feature.rb +++ b/lib/chef/resource/windows_feature.rb @@ -28,28 +28,28 @@ class Chef introduced "14.0" property :feature_name, [Array, String], - description: "The name of the feature(s) or role(s) to install if they differ from the resource block's name. The same feature may have different names depending on the underlying installation method being used (ie DHCPServer vs DHCP; DNS-Server-Full-Role vs DNS).", - name_property: true + description: "The name of the feature(s) or role(s) to install if they differ from the resource block's name. The same feature may have different names depending on the underlying installation method being used (ie DHCPServer vs DHCP; DNS-Server-Full-Role vs DNS).", + name_property: true property :source, String, - description: "Specify a local repository for the feature install." + description: "Specify a local repository for the feature install." property :all, [TrueClass, FalseClass], - description: "Install all sub features.", - default: false + description: "Install all sub features.", + default: false property :management_tools, [TrueClass, FalseClass], - description: "Install all applicable management tools for the roles, role services, or features (PowerShell-only).", - default: false + description: "Install all applicable management tools for the roles, role services, or features (PowerShell-only).", + default: false property :install_method, Symbol, - description: "The underlying installation method to use for feature installation. Specify ':windows_feature_dism' for DISM or ':windows_feature_powershell' for PowerShell.", - equal_to: [:windows_feature_dism, :windows_feature_powershell, :windows_feature_servermanagercmd], - default: :windows_feature_dism + description: "The underlying installation method to use for feature installation. Specify ':windows_feature_dism' for DISM or ':windows_feature_powershell' for PowerShell.", + equal_to: [:windows_feature_dism, :windows_feature_powershell, :windows_feature_servermanagercmd], + default: :windows_feature_dism property :timeout, Integer, - description: "Specifies a timeout (in seconds) for the feature installation.", - default: 600 + description: "Specifies a timeout (in seconds) for the feature installation.", + default: 600 action :install do description "Install a Windows role/feature" diff --git a/lib/chef/resource/windows_feature_dism.rb b/lib/chef/resource/windows_feature_dism.rb index 5205bb55e9..4bbfff9823 100644 --- a/lib/chef/resource/windows_feature_dism.rb +++ b/lib/chef/resource/windows_feature_dism.rb @@ -29,20 +29,20 @@ class Chef introduced "14.0" property :feature_name, [Array, String], - description: "The name of the feature(s) or role(s) to install if they differ from the resource name.", - coerce: proc { |x| to_formatted_array(x) }, - name_property: true + description: "The name of the feature(s) or role(s) to install if they differ from the resource name.", + coerce: proc { |x| to_formatted_array(x) }, + name_property: true property :source, String, - description: "Specify a local repository for the feature install." + description: "Specify a local repository for the feature install." property :all, [TrueClass, FalseClass], - description: "Install all sub-features. When set to 'true', this is the equivalent of specifying the /All switch to dism.exe", - default: false + description: "Install all sub-features. When set to 'true', this is the equivalent of specifying the /All switch to dism.exe", + default: false property :timeout, Integer, - description: "Specifies a timeout (in seconds) for the feature installation.", - default: 600 + description: "Specifies a timeout (in seconds) for the feature installation.", + default: 600 # @return [Array] lowercase the array unless we're on < Windows 2012 def to_formatted_array(x) diff --git a/lib/chef/resource/windows_feature_powershell.rb b/lib/chef/resource/windows_feature_powershell.rb index 55513ea3ea..6806c92fb9 100644 --- a/lib/chef/resource/windows_feature_powershell.rb +++ b/lib/chef/resource/windows_feature_powershell.rb @@ -31,24 +31,24 @@ class Chef introduced "14.0" property :feature_name, [Array, String], - description: "The name of the feature(s) or role(s) to install if they differ from the resource block's name.", - coerce: proc { |x| to_formatted_array(x) }, - name_property: true + description: "The name of the feature(s) or role(s) to install if they differ from the resource block's name.", + coerce: proc { |x| to_formatted_array(x) }, + name_property: true property :source, String, - description: "Specify a local repository for the feature install." + description: "Specify a local repository for the feature install." property :all, [TrueClass, FalseClass], - description: "Install all subfeatures. When set to 'true', this is the equivalent of specifying the '-InstallAllSubFeatures' switch with 'Add-WindowsFeature'.", - default: false + description: "Install all subfeatures. When set to 'true', this is the equivalent of specifying the '-InstallAllSubFeatures' switch with 'Add-WindowsFeature'.", + default: false property :timeout, Integer, - description: "Specifies a timeout (in seconds) for the feature installation.", - default: 600 + description: "Specifies a timeout (in seconds) for the feature installation.", + default: 600 property :management_tools, [TrueClass, FalseClass], - description: "Install all applicable management tools for the roles, role services, or features.", - default: false + description: "Install all applicable management tools for the roles, role services, or features.", + default: false # Converts strings of features into an Array. Array objects are lowercased unless we're on < 8/2k12+. # @return [Array] array of features diff --git a/lib/chef/resource/windows_firewall_rule.rb b/lib/chef/resource/windows_firewall_rule.rb index 3dbc5d6b0f..f933ba9139 100644 --- a/lib/chef/resource/windows_firewall_rule.rb +++ b/lib/chef/resource/windows_firewall_rule.rb @@ -30,62 +30,62 @@ class Chef introduced "14.7" property :rule_name, String, - name_property: true, - description: "An optional property to set the name of the firewall rule to assign if it differs from the resource block's name." + name_property: true, + description: "An optional property to set the name of the firewall rule to assign if it differs from the resource block's name." property :description, String, - default: "Firewall rule", - description: "The description to assign to the firewall rule." + default: "Firewall rule", + description: "The description to assign to the firewall rule." property :local_address, String, - description: "The local address the firewall rule applies to." + description: "The local address the firewall rule applies to." property :local_port, [String, Integer, Array], # split various formats of comma separated lists and provide a sorted array of strings to match PS output - coerce: proc { |d| d.is_a?(String) ? d.split(/\s*,\s*/).sort : Array(d).sort.map { |x| x.to_s } }, - description: "The local port the firewall rule applies to." + coerce: proc { |d| d.is_a?(String) ? d.split(/\s*,\s*/).sort : Array(d).sort.map { |x| x.to_s } }, + description: "The local port the firewall rule applies to." property :remote_address, String, - description: "The remote address the firewall rule applies to." + description: "The remote address the firewall rule applies to." property :remote_port, [String, Integer, Array], # split various formats of comma separated lists and provide a sorted array of strings to match PS output - coerce: proc { |d| d.is_a?(String) ? d.split(/\s*,\s*/).sort : Array(d).sort.map { |x| x.to_s } }, - description: "The remote port the firewall rule applies to." + coerce: proc { |d| d.is_a?(String) ? d.split(/\s*,\s*/).sort : Array(d).sort.map { |x| x.to_s } }, + description: "The remote port the firewall rule applies to." property :direction, [Symbol, String], - default: :inbound, equal_to: [:inbound, :outbound], - description: "The direction of the firewall rule. Direction means either inbound or outbound traffic.", - coerce: proc { |d| d.is_a?(String) ? d.downcase.to_sym : d } + default: :inbound, equal_to: [:inbound, :outbound], + description: "The direction of the firewall rule. Direction means either inbound or outbound traffic.", + coerce: proc { |d| d.is_a?(String) ? d.downcase.to_sym : d } property :protocol, String, - default: "TCP", - description: "The protocol the firewall rule applies to." + default: "TCP", + description: "The protocol the firewall rule applies to." property :firewall_action, [Symbol, String], - default: :allow, equal_to: [:allow, :block, :notconfigured], - description: "The action of the firewall rule.", - coerce: proc { |f| f.is_a?(String) ? f.downcase.to_sym : f } + default: :allow, equal_to: [:allow, :block, :notconfigured], + description: "The action of the firewall rule.", + coerce: proc { |f| f.is_a?(String) ? f.downcase.to_sym : f } property :profile, [Symbol, String], - default: :any, equal_to: [:public, :private, :domain, :any, :notapplicable], - description: "The profile the firewall rule applies to.", - coerce: proc { |p| p.is_a?(String) ? p.downcase.to_sym : p } + default: :any, equal_to: [:public, :private, :domain, :any, :notapplicable], + description: "The profile the firewall rule applies to.", + coerce: proc { |p| p.is_a?(String) ? p.downcase.to_sym : p } property :program, String, - description: "The program the firewall rule applies to." + description: "The program the firewall rule applies to." property :service, String, - description: "The service the firewall rule applies to." + description: "The service the firewall rule applies to." property :interface_type, [Symbol, String], - default: :any, equal_to: [:any, :wireless, :wired, :remoteaccess], - description: "The interface type the firewall rule applies to.", - coerce: proc { |i| i.is_a?(String) ? i.downcase.to_sym : i } + default: :any, equal_to: [:any, :wireless, :wired, :remoteaccess], + description: "The interface type the firewall rule applies to.", + coerce: proc { |i| i.is_a?(String) ? i.downcase.to_sym : i } property :enabled, [TrueClass, FalseClass], - default: true, - description: "Whether or not to enable the firewall rule." + default: true, + description: "Whether or not to enable the firewall rule." alias_method :localip, :local_address alias_method :remoteip, :remote_address @@ -120,7 +120,7 @@ class Chef if current_resource converge_if_changed :rule_name, :local_address, :local_port, :remote_address, :remote_port, :direction, - :protocol, :firewall_action, :profile, :program, :service, :interface_type, :enabled do + :protocol, :firewall_action, :profile, :program, :service, :interface_type, :enabled do cmd = firewall_command("Set") powershell_out!(cmd) end diff --git a/lib/chef/resource/windows_font.rb b/lib/chef/resource/windows_font.rb index 333769c3cd..64644a815f 100644 --- a/lib/chef/resource/windows_font.rb +++ b/lib/chef/resource/windows_font.rb @@ -29,12 +29,12 @@ class Chef introduced "14.0" property :font_name, String, - description: "An optional property to set the name of the font to install if it differs from the resource block's name.", - name_property: true + description: "An optional property to set the name of the font to install if it differs from the resource block's name.", + name_property: true property :source, String, - description: "A local filesystem path or URI that is used to source the font file.", - coerce: proc { |x| x =~ /^.:.*/ ? x.tr('\\', "/").gsub("//", "/") : x } + description: "A local filesystem path or URI that is used to source the font file.", + coerce: proc { |x| x =~ /^.:.*/ ? x.tr('\\', "/").gsub("//", "/") : x } action :install do description "Install a font to the system fonts directory." diff --git a/lib/chef/resource/windows_package.rb b/lib/chef/resource/windows_package.rb index b1ee7096b6..5592e537b4 100644 --- a/lib/chef/resource/windows_package.rb +++ b/lib/chef/resource/windows_package.rb @@ -49,11 +49,11 @@ class Chef # In the past we accepted return code 127 for an unknown reason and 42 because of a bug property :returns, [ String, Integer, Array ], default: [ 0 ], desired_state: false property :source, String, - coerce: (proc do |s| - unless s.nil? - uri_scheme?(s) ? s : Chef::Util::PathHelper.canonical_path(s, false) - end - end) + coerce: (proc do |s| + unless s.nil? + uri_scheme?(s) ? s : Chef::Util::PathHelper.canonical_path(s, false) + end + end) property :checksum, String, desired_state: false property :remote_file_attributes, Hash, desired_state: false end diff --git a/lib/chef/resource/windows_pagefile.rb b/lib/chef/resource/windows_pagefile.rb index 964aeaaf95..8249436144 100644 --- a/lib/chef/resource/windows_pagefile.rb +++ b/lib/chef/resource/windows_pagefile.rb @@ -27,22 +27,22 @@ class Chef introduced "14.0" property :path, String, - coerce: proc { |x| x.tr("/", '\\') }, - description: "An optional property to set the pagefile name if it differs from the resource block's name.", - name_property: true + coerce: proc { |x| x.tr("/", '\\') }, + description: "An optional property to set the pagefile name if it differs from the resource block's name.", + name_property: true property :system_managed, [TrueClass, FalseClass], - description: "Configures whether the system manages the pagefile size." + description: "Configures whether the system manages the pagefile size." property :automatic_managed, [TrueClass, FalseClass], - description: "Enable automatic management of pagefile initial and maximum size. Setting this to true ignores 'initial_size' and 'maximum_size' properties.", - default: false + description: "Enable automatic management of pagefile initial and maximum size. Setting this to true ignores 'initial_size' and 'maximum_size' properties.", + default: false property :initial_size, Integer, - description: "Initial size of the pagefile in megabytes." + description: "Initial size of the pagefile in megabytes." property :maximum_size, Integer, - description: "Maximum size of the pagefile in megabytes." + description: "Maximum size of the pagefile in megabytes." action :set do description "Configures the default pagefile, creating if it doesn't exist." diff --git a/lib/chef/resource/windows_path.rb b/lib/chef/resource/windows_path.rb index c39ce0ce8f..0067de5baf 100644 --- a/lib/chef/resource/windows_path.rb +++ b/lib/chef/resource/windows_path.rb @@ -31,8 +31,8 @@ class Chef default_action :add property :path, String, - description: "An optional property to set the path value if it differs from the resource block's name.", - name_property: true + description: "An optional property to set the path value if it differs from the resource block's name.", + name_property: true end end end diff --git a/lib/chef/resource/windows_printer.rb b/lib/chef/resource/windows_printer.rb index cdad1f50a2..d782c1b360 100644 --- a/lib/chef/resource/windows_printer.rb +++ b/lib/chef/resource/windows_printer.rb @@ -31,37 +31,37 @@ class Chef introduced "14.0" property :device_id, String, - description: "An optional property to set the printer queue name if it differs from the resource block's name. Example: 'HP LJ 5200 in fifth floor copy room'.", - name_property: true + description: "An optional property to set the printer queue name if it differs from the resource block's name. Example: 'HP LJ 5200 in fifth floor copy room'.", + name_property: true property :comment, String, - description: "Optional descriptor for the printer queue." + description: "Optional descriptor for the printer queue." property :default, [TrueClass, FalseClass], - description: "Determines whether or not this should be the system's default printer.", - default: false + description: "Determines whether or not this should be the system's default printer.", + default: false property :driver_name, String, - description: "The exact name of printer driver installed on the system.", - required: true + description: "The exact name of printer driver installed on the system.", + required: true property :location, String, - description: "Printer location, such as 'Fifth floor copy room'." + description: "Printer location, such as 'Fifth floor copy room'." property :shared, [TrueClass, FalseClass], - description: "Determines whether or not the printer is shared.", - default: false + description: "Determines whether or not the printer is shared.", + default: false property :share_name, String, - description: "The name used to identify the shared printer." + description: "The name used to identify the shared printer." property :ipv4_address, String, - description: "The IPv4 address of the printer, such as '10.4.64.23'", - validation_message: "The ipv4_address property must be in the IPv4 format of WWW.XXX.YYY.ZZZ", - regex: Resolv::IPv4::Regex + description: "The IPv4 address of the printer, such as '10.4.64.23'", + validation_message: "The ipv4_address property must be in the IPv4 format of WWW.XXX.YYY.ZZZ", + regex: Resolv::IPv4::Regex property :exists, [TrueClass, FalseClass], - skip_docs: true + skip_docs: true PRINTERS_REG_KEY = 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers\\'.freeze unless defined?(PRINTERS_REG_KEY) diff --git a/lib/chef/resource/windows_printer_port.rb b/lib/chef/resource/windows_printer_port.rb index a31c49d734..cd1a5f55c2 100644 --- a/lib/chef/resource/windows_printer_port.rb +++ b/lib/chef/resource/windows_printer_port.rb @@ -31,32 +31,32 @@ class Chef introduced "14.0" property :ipv4_address, String, - name_property: true, - regex: Resolv::IPv4::Regex, - validation_message: "The ipv4_address property must be in the format of WWW.XXX.YYY.ZZZ!", - description: "An optional property for the IPv4 address of the printer if it differs from the resource block's name." + name_property: true, + regex: Resolv::IPv4::Regex, + validation_message: "The ipv4_address property must be in the format of WWW.XXX.YYY.ZZZ!", + description: "An optional property for the IPv4 address of the printer if it differs from the resource block's name." property :port_name, String, - description: "The port name." + description: "The port name." property :port_number, Integer, - description: "The port number.", - default: 9100 + description: "The port number.", + default: 9100 property :port_description, String, - description: "The description of the port." + description: "The description of the port." property :snmp_enabled, [TrueClass, FalseClass], - description: "Determines if SNMP is enabled on the port.", - default: false + description: "Determines if SNMP is enabled on the port.", + default: false property :port_protocol, Integer, - description: "The printer port protocol: 1 (RAW) or 2 (LPR).", - validation_message: "port_protocol must be either 1 for RAW or 2 for LPR!", - default: 1, equal_to: [1, 2] + description: "The printer port protocol: 1 (RAW) or 2 (LPR).", + validation_message: "port_protocol must be either 1 for RAW or 2 for LPR!", + default: 1, equal_to: [1, 2] property :exists, [TrueClass, FalseClass], - skip_docs: true + skip_docs: true PORTS_REG_KEY = 'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\Standard TCP/IP Port\Ports\\'.freeze unless defined?(PORTS_REG_KEY) diff --git a/lib/chef/resource/windows_service.rb b/lib/chef/resource/windows_service.rb index 6853d539ab..91c3450603 100644 --- a/lib/chef/resource/windows_service.rb +++ b/lib/chef/resource/windows_service.rb @@ -75,25 +75,25 @@ class Chef # 1 == delayed start is enabled # 0 == NO delayed start property :delayed_start, [TrueClass, FalseClass], - introduced: "14.0", - default: false, coerce: proc { |x| - if x.is_a?(Integer) - x == 0 ? false : true - else - x - end - } + introduced: "14.0", + default: false, coerce: proc { |x| + if x.is_a?(Integer) + x == 0 ? false : true + else + x + end + } # https://github.com/chef/win32-service/blob/ffi/lib/win32/windows/constants.rb#L43-L47 property :error_control, Integer, default: SERVICE_ERROR_NORMAL property :binary_path_name, String, - introduced: "14.0", - description: "The fully qualified path to the service binary file. The path can also include arguments for an auto-start service. This is required for ':create' and ':configure' actions" + introduced: "14.0", + description: "The fully qualified path to the service binary file. The path can also include arguments for an auto-start service. This is required for ':create' and ':configure' actions" property :load_order_group, String, - introduced: "14.0", - description: "The names of the load ordering group of which this service is a member. Don't set this property if the service does not belong to a group." + introduced: "14.0", + description: "The names of the load ordering group of which this service is a member. Don't set this property if the service does not belong to a group." # A pointer to a double null-terminated array of null-separated names of # services or load ordering groups that the system must start before this @@ -102,11 +102,11 @@ class Chef # at least one member of the group is running after an attempt to start # all members of the group. property :dependencies, [String, Array], - introduced: "14.0" + introduced: "14.0" property :description, String, - description: "Description of the service.", - introduced: "14.0" + description: "Description of the service.", + introduced: "14.0" property :run_as_user, String, default: "LocalSystem" property :run_as_password, String, default: "" diff --git a/lib/chef/resource/windows_share.rb b/lib/chef/resource/windows_share.rb index a06d0b1aeb..0dcf49e432 100644 --- a/lib/chef/resource/windows_share.rb +++ b/lib/chef/resource/windows_share.rb @@ -33,65 +33,65 @@ class Chef # Specifies a name for the SMB share. The name may be composed of any valid file name characters, but must be less than 80 characters long. The names pipe and mailslot are reserved for use by the computer. property :share_name, String, - description: "An optional property to set the share name if it differs from the resource block's name.", - name_property: true + description: "An optional property to set the share name if it differs from the resource block's name.", + name_property: true # Specifies the path of the location of the folder to share. The path must be fully qualified. Relative paths or paths that contain wildcard characters are not permitted. property :path, String, - description: "The path of the folder to share. Required when creating. If the share already exists on a different path then it is deleted and re-created." + description: "The path of the folder to share. Required when creating. If the share already exists on a different path then it is deleted and re-created." # Specifies an optional description of the SMB share. A description of the share is displayed by running the Get-SmbShare cmdlet. The description may not contain more than 256 characters. property :description, String, - description: "The description to be applied to the share.", - default: "" + description: "The description to be applied to the share.", + default: "" # Specifies which accounts are granted full permission to access the share. Use a comma-separated list to specify multiple accounts. An account may not be specified more than once in the FullAccess, ChangeAccess, or ReadAccess parameter lists, but may be specified once in the FullAccess, ChangeAccess, or ReadAccess parameter list and once in the NoAccess parameter list. property :full_users, Array, - description: "The users that should have 'Full control' permissions on the share in domain\\username format.", - default: lazy { [] }, coerce: proc { |u| u.sort } + description: "The users that should have 'Full control' permissions on the share in domain\\username format.", + default: lazy { [] }, coerce: proc { |u| u.sort } # Specifies which users are granted modify permission to access the share property :change_users, Array, - description: "The users that should have 'modify' permission on the share in domain\\username format.", - default: lazy { [] }, coerce: proc { |u| u.sort } + description: "The users that should have 'modify' permission on the share in domain\\username format.", + default: lazy { [] }, coerce: proc { |u| u.sort } # Specifies which users are granted read permission to access the share. Multiple users can be specified by supplying a comma-separated list. property :read_users, Array, - description: "The users that should have 'read' permission on the share in domain\\username format.", - default: lazy { [] }, coerce: proc { |u| u.sort } + description: "The users that should have 'read' permission on the share in domain\\username format.", + default: lazy { [] }, coerce: proc { |u| u.sort } # Specifies the lifetime of the new SMB share. A temporary share does not persist beyond the next restart of the computer. By default, new SMB shares are persistent, and non-temporary. property :temporary, [TrueClass, FalseClass], - description: "The lifetime of the new SMB share. A temporary share does not persist beyond the next restart of the computer.", - default: false + description: "The lifetime of the new SMB share. A temporary share does not persist beyond the next restart of the computer.", + default: false # Specifies the scope name of the share. property :scope_name, String, - description: "The scope name of the share.", - default: "*" + description: "The scope name of the share.", + default: "*" # Specifies the continuous availability time-out for the share. property :ca_timeout, Integer, - description: "The continuous availability time-out for the share.", - default: 0 + description: "The continuous availability time-out for the share.", + default: 0 # Indicates that the share is continuously available. property :continuously_available, [TrueClass, FalseClass], - description: "Indicates that the share is continuously available.", - default: false + description: "Indicates that the share is continuously available.", + default: false # Specifies the caching mode of the offline files for the SMB share. # property :caching_mode, String, equal_to: %w(None Manual Documents Programs BranchCache) # Specifies the maximum number of concurrently connected users that the new SMB share may accommodate. If this parameter is set to zero (0), then the number of users is unlimited. property :concurrent_user_limit, Integer, - description: "The maximum number of concurrently connected users the share can accommodate.", - default: 0 + description: "The maximum number of concurrently connected users the share can accommodate.", + default: 0 # Indicates that the share is encrypted. property :encrypt_data, [TrueClass, FalseClass], - description: "Indicates that the share is encrypted.", - default: false + description: "Indicates that the share is encrypted.", + default: false # Specifies which files and folders in the SMB share are visible to users. AccessBased: SMB does not the display the files and folders for a share to a user unless that user has rights to access the files and folders. By default, access-based enumeration is disabled for new SMB shares. Unrestricted: SMB displays files and folders to a user even when the user does not have permission to access the items. # property :folder_enumeration_mode, String, equal_to: %(AccessBased Unrestricted) diff --git a/lib/chef/resource/windows_shortcut.rb b/lib/chef/resource/windows_shortcut.rb index 472b5f78f8..0c6dc63e6e 100644 --- a/lib/chef/resource/windows_shortcut.rb +++ b/lib/chef/resource/windows_shortcut.rb @@ -28,23 +28,23 @@ class Chef introduced "14.0" property :shortcut_name, String, - description: "An optional property to set the shortcut name if it differs from the resource block's name.", - name_property: true + description: "An optional property to set the shortcut name if it differs from the resource block's name.", + name_property: true property :target, String, - description: "The destination that the shortcut links to." + description: "The destination that the shortcut links to." property :arguments, String, - description: "Arguments to pass to the target when the shortcut is executed." + description: "Arguments to pass to the target when the shortcut is executed." property :description, String, - description: "The description of the shortcut" + description: "The description of the shortcut" property :cwd, String, - description: "Working directory to use when the target is executed." + description: "Working directory to use when the target is executed." property :iconlocation, String, - description: "Icon to use for the shortcut. Accepts the format of 'path, index', where index is the icon file to use. See https://msdn.microsoft.com/en-us/library/3s9bx7at.aspx for details" + description: "Icon to use for the shortcut. Accepts the format of 'path, index', where index is the icon file to use. See https://msdn.microsoft.com/en-us/library/3s9bx7at.aspx for details" load_current_value do |desired| require "win32ole" if RUBY_PLATFORM =~ /mswin|mingw32|windows/ diff --git a/lib/chef/resource/windows_task.rb b/lib/chef/resource/windows_task.rb index 56504e1f17..b985231c8a 100644 --- a/lib/chef/resource/windows_task.rb +++ b/lib/chef/resource/windows_task.rb @@ -36,33 +36,33 @@ class Chef name_property: true property :command, String, - description: "The command to be executed by the windows scheduled task." + description: "The command to be executed by the windows scheduled task." property :cwd, String, - description: "The directory the task will be run from." + description: "The directory the task will be run from." property :user, String, - description: "The user to run the task as.", - default: lazy { Chef::ReservedNames::Win32::Security::SID.LocalSystem.account_simple_name if Chef::Platform.windows? }, - default_description: "The localized SYSTEM user for the node." + description: "The user to run the task as.", + default: lazy { Chef::ReservedNames::Win32::Security::SID.LocalSystem.account_simple_name if Chef::Platform.windows? }, + default_description: "The localized SYSTEM user for the node." property :password, String, - description: "The user’s password. The user property must be set if using this property." + description: "The user’s password. The user property must be set if using this property." property :run_level, Symbol, equal_to: [:highest, :limited], description: "Run with ':limited' or ':highest' privileges.", default: :limited property :force, [TrueClass, FalseClass], - description: "When used with create, will update the task.", - default: false + description: "When used with create, will update the task.", + default: false property :interactive_enabled, [TrueClass, FalseClass], - description: "Allow task to run interactively or non-interactively. Requires user and password to also be set.", - default: false + description: "Allow task to run interactively or non-interactively. Requires user and password to also be set.", + default: false property :frequency_modifier, [Integer, String], - default: 1 + default: 1 property :frequency, Symbol, equal_to: [:minute, :hourly, @@ -77,52 +77,52 @@ class Chef description: "The frequency with which to run the task." property :start_day, String, - description: "Specifies the first date on which the task runs in MM/DD/YYYY format." + description: "Specifies the first date on which the task runs in MM/DD/YYYY format." property :start_time, String, - description: "Specifies the start time to run the task, in HH:mm format." + description: "Specifies the start time to run the task, in HH:mm format." property :day, [String, Integer], - description: "The day(s) on which the task runs." + description: "The day(s) on which the task runs." property :months, String, - description: "The Months of the year on which the task runs, such as: 'JAN, FEB' or '\*'. Multiple months should be comma delimited. e.g. 'Jan, Feb, Mar, Dec'." + description: "The Months of the year on which the task runs, such as: 'JAN, FEB' or '\*'. Multiple months should be comma delimited. e.g. 'Jan, Feb, Mar, Dec'." property :idle_time, Integer, - description: "For :on_idle frequency, the time (in minutes) without user activity that must pass to trigger the task, from 1 - 999." + description: "For :on_idle frequency, the time (in minutes) without user activity that must pass to trigger the task, from 1 - 999." property :random_delay, [String, Integer], - description: "Delays the task up to a given time (in seconds)." + description: "Delays the task up to a given time (in seconds)." property :execution_time_limit, [String, Integer], - description: "The maximum time (in seconds) the task will run.", - default: "PT72H" # 72 hours in ISO8601 duration format + description: "The maximum time (in seconds) the task will run.", + default: "PT72H" # 72 hours in ISO8601 duration format property :minutes_duration, [String, Integer], - description: "" + description: "" property :minutes_interval, [String, Integer], - description: "" + description: "" property :priority, Integer, - description: "Use to set Priority Levels range from 0 to 10.", - default: 7, callbacks: { "should be in range of 0 to 10" => proc { |v| v >= 0 && v <= 10 } } + description: "Use to set Priority Levels range from 0 to 10.", + default: 7, callbacks: { "should be in range of 0 to 10" => proc { |v| v >= 0 && v <= 10 } } property :disallow_start_if_on_batteries, [TrueClass, FalseClass], - introduced: "14.4", default: false, - description: "Disallow start of the task if the system is running on battery power." + introduced: "14.4", default: false, + description: "Disallow start of the task if the system is running on battery power." property :stop_if_going_on_batteries, [TrueClass, FalseClass], - introduced: "14.4", default: false, - description: "Scheduled task option when system is switching on battery." + introduced: "14.4", default: false, + description: "Scheduled task option when system is switching on battery." property :description, String, - introduced: "14.7", - description: "The task description." + introduced: "14.7", + description: "The task description." property :start_when_available, [TrueClass, FalseClass], - introduced: "15.0", default: false, - description: "To start the task at any time after its scheduled time has passed." + introduced: "15.0", default: false, + description: "To start the task at any time after its scheduled time has passed." attr_accessor :exists, :task, :command_arguments diff --git a/lib/chef/resource/windows_uac.rb b/lib/chef/resource/windows_uac.rb index 1a2e61ad7f..f53767f4b8 100644 --- a/lib/chef/resource/windows_uac.rb +++ b/lib/chef/resource/windows_uac.rb @@ -28,29 +28,29 @@ class Chef # https://docs.microsoft.com/en-us/windows/security/identity-protection/user-account-control/user-account-control-group-policy-and-registry-key-settings#user-account-control-virtualize-file-and-registry-write-failures-to-per-user-locations property :enable_uac, [TrueClass, FalseClass], - description: 'Enable or disable UAC Admin Approval Mode. If this is changed a system restart is required. Sets HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA.', - default: true # EnableLUA + description: 'Enable or disable UAC Admin Approval Mode. If this is changed a system restart is required. Sets HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA.', + default: true # EnableLUA property :require_signed_binaries, [TrueClass, FalseClass], - description: 'Only elevate executables that are signed and validated. Sets HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA\ValidateAdminCodeSignatures.', - default: false + description: 'Only elevate executables that are signed and validated. Sets HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA\ValidateAdminCodeSignatures.', + default: false property :prompt_on_secure_desktop, [TrueClass, FalseClass], - description: 'Switch to the secure desktop when prompting for elevation. Sets HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA\PromptOnSecureDesktop.', - default: true + description: 'Switch to the secure desktop when prompting for elevation. Sets HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA\PromptOnSecureDesktop.', + default: true property :detect_installers, [TrueClass, FalseClass], - description: 'Detect application installations and prompt for elevation. Sets HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA\EnableInstallerDetection.' + description: 'Detect application installations and prompt for elevation. Sets HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA\EnableInstallerDetection.' property :consent_behavior_admins, Symbol, - description: 'Behavior of the elevation prompt for administrators in Admin Approval Mode. Sets HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA\ConsentPromptBehaviorAdmin.', - equal_to: [:no_prompt, :secure_prompt_for_creds, :secure_prompt_for_consent, :prompt_for_creds, :prompt_for_consent, :prompt_for_consent_non_windows_binaries], - default: :prompt_for_consent_non_windows_binaries + description: 'Behavior of the elevation prompt for administrators in Admin Approval Mode. Sets HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA\ConsentPromptBehaviorAdmin.', + equal_to: [:no_prompt, :secure_prompt_for_creds, :secure_prompt_for_consent, :prompt_for_creds, :prompt_for_consent, :prompt_for_consent_non_windows_binaries], + default: :prompt_for_consent_non_windows_binaries property :consent_behavior_users, Symbol, - description: 'Behavior of the elevation prompt for standard users. Sets HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA\ConsentPromptBehaviorUser.', - equal_to: [:auto_deny, :secure_prompt_for_creds, :prompt_for_creds], - default: :prompt_for_creds + description: 'Behavior of the elevation prompt for standard users. Sets HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA\ConsentPromptBehaviorUser.', + equal_to: [:auto_deny, :secure_prompt_for_creds, :prompt_for_creds], + default: :prompt_for_creds action :configure do description 'Configures UAC by setting registry keys at \'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\'' diff --git a/lib/chef/resource/windows_workgroup.rb b/lib/chef/resource/windows_workgroup.rb index 4c96f13738..3a983b6987 100644 --- a/lib/chef/resource/windows_workgroup.rb +++ b/lib/chef/resource/windows_workgroup.rb @@ -31,25 +31,25 @@ class Chef introduced "14.5" property :workgroup_name, String, - description: "An optional property to set the workgroup name if it differs from the resource block's name.", - validation_message: "The 'workgroup_name' property must not contain spaces.", - regex: /^\S*$/, # no spaces - name_property: true + description: "An optional property to set the workgroup name if it differs from the resource block's name.", + validation_message: "The 'workgroup_name' property must not contain spaces.", + regex: /^\S*$/, # no spaces + name_property: true property :user, String, - description: "The local administrator user to use to change the workgroup. Required if using the password property.", - desired_state: false + description: "The local administrator user to use to change the workgroup. Required if using the password property.", + desired_state: false property :password, String, - description: "The password for the local administrator user. Required if using the user property.", - desired_state: false + description: "The password for the local administrator user. Required if using the user property.", + desired_state: false property :reboot, Symbol, - equal_to: [:never, :request_reboot, :reboot_now], - validation_message: "The reboot property accepts :immediate (reboot as soon as the resource completes), :delayed (reboot once the #{Chef::Dist::PRODUCT} run completes), and :never (Don't reboot)", - description: "Controls the system reboot behavior post workgroup joining. Reboot immediately, after the #{Chef::Dist::PRODUCT} run completes, or never. Note that a reboot is necessary for changes to take effect.", - coerce: proc { |x| clarify_reboot(x) }, - default: :immediate, desired_state: false + equal_to: [:never, :request_reboot, :reboot_now], + validation_message: "The reboot property accepts :immediate (reboot as soon as the resource completes), :delayed (reboot once the #{Chef::Dist::PRODUCT} run completes), and :never (Don't reboot)", + description: "Controls the system reboot behavior post workgroup joining. Reboot immediately, after the #{Chef::Dist::PRODUCT} run completes, or never. Note that a reboot is necessary for changes to take effect.", + coerce: proc { |x| clarify_reboot(x) }, + default: :immediate, desired_state: false # This resource historically took `:immediate` and `:delayed` as arguments to the reboot property but then # tried to shove that straight to the `reboot` resource which objected strenuously. We need to convert these @@ -69,7 +69,7 @@ class Chef # define this again so we can default it to true. Otherwise failures print the password property :sensitive, [TrueClass, FalseClass], - default: true, desired_state: false + default: true, desired_state: false action :join do description "Update the workgroup." diff --git a/lib/chef/resource/yum_package.rb b/lib/chef/resource/yum_package.rb index 85efab633b..ce9a5654b5 100644 --- a/lib/chef/resource/yum_package.rb +++ b/lib/chef/resource/yum_package.rb @@ -40,38 +40,38 @@ class Chef # of variables eliminate entire classes of bugs). # </lecture> property :package_name, [ String, Array ], - description: "One of the following: the name of a package, the name of a package and its architecture, the name of a dependency.", - identity: true, coerce: proc { |x| x.is_a?(Array) ? x.to_a : x } + description: "One of the following: the name of a package, the name of a package and its architecture, the name of a dependency.", + identity: true, coerce: proc { |x| x.is_a?(Array) ? x.to_a : x } property :version, [ String, Array ], - description: "The version of a package to be installed or upgraded. This property is ignored when using the ':upgrade' action.", - coerce: proc { |x| x.is_a?(Array) ? x.to_a : x } + description: "The version of a package to be installed or upgraded. This property is ignored when using the ':upgrade' action.", + coerce: proc { |x| x.is_a?(Array) ? x.to_a : x } property :arch, [ String, Array ], - description: "The architecture of the package to be installed or upgraded. This value can also be passed as part of the package name.", - coerce: proc { |x| x.is_a?(Array) ? x.to_a : x } + description: "The architecture of the package to be installed or upgraded. This value can also be passed as part of the package name.", + coerce: proc { |x| x.is_a?(Array) ? x.to_a : x } property :flush_cache, Hash, - description: "Flush the in-memory cache before or after a Yum operation that installs, upgrades, or removes a package. Accepts a Hash in the form: { :before => true/false, :after => true/false } or an Array in the form [ :before, :after ].\nYum automatically synchronizes remote metadata to a local cache. The #{Chef::Dist::CLIENT} creates a copy of the local cache, and then stores it in-memory during the #{Chef::Dist::CLIENT} run. The in-memory cache allows packages to be installed during the #{Chef::Dist::CLIENT} run without the need to continue synchronizing the remote metadata to the local cache while the #{Chef::Dist::CLIENT} run is in-progress.", - default: { before: false, after: false }, - coerce: proc { |v| - if v.is_a?(Hash) - v - elsif v.is_a?(Array) - v.each_with_object({}) { |arg, obj| obj[arg] = true } - elsif v.is_a?(TrueClass) || v.is_a?(FalseClass) - { before: v, after: v } - elsif v == :before - { before: true, after: false } - elsif v == :after - { after: true, before: false } - end - } + description: "Flush the in-memory cache before or after a Yum operation that installs, upgrades, or removes a package. Accepts a Hash in the form: { :before => true/false, :after => true/false } or an Array in the form [ :before, :after ].\nYum automatically synchronizes remote metadata to a local cache. The #{Chef::Dist::CLIENT} creates a copy of the local cache, and then stores it in-memory during the #{Chef::Dist::CLIENT} run. The in-memory cache allows packages to be installed during the #{Chef::Dist::CLIENT} run without the need to continue synchronizing the remote metadata to the local cache while the #{Chef::Dist::CLIENT} run is in-progress.", + default: { before: false, after: false }, + coerce: proc { |v| + if v.is_a?(Hash) + v + elsif v.is_a?(Array) + v.each_with_object({}) { |arg, obj| obj[arg] = true } + elsif v.is_a?(TrueClass) || v.is_a?(FalseClass) + { before: v, after: v } + elsif v == :before + { before: true, after: false } + elsif v == :after + { after: true, before: false } + end + } property :allow_downgrade, [ true, false ], - description: "Downgrade a package to satisfy requested version requirements.", - default: true, - desired_state: false + description: "Downgrade a package to satisfy requested version requirements.", + default: true, + desired_state: false property :yum_binary, String end diff --git a/lib/chef/resource/yum_repository.rb b/lib/chef/resource/yum_repository.rb index 9574b53bb1..1883439da1 100644 --- a/lib/chef/resource/yum_repository.rb +++ b/lib/chef/resource/yum_repository.rb @@ -33,74 +33,74 @@ class Chef # http://linux.die.net/man/5/yum.conf as well as # http://dnf.readthedocs.io/en/latest/conf_ref.html property :baseurl, [String, Array], - description: "URL to the directory where the Yum repository's 'repodata' directory lives. Can be an http://, https:// or a ftp:// URL. You can specify multiple URLs in one baseurl statement." + description: "URL to the directory where the Yum repository's 'repodata' directory lives. Can be an http://, https:// or a ftp:// URL. You can specify multiple URLs in one baseurl statement." property :clean_headers, [TrueClass, FalseClass], - description: "Specifies whether you want to purge the package data files that are downloaded from a Yum repository and held in a cache directory.", - deprecated: true, - default: false # deprecated + description: "Specifies whether you want to purge the package data files that are downloaded from a Yum repository and held in a cache directory.", + deprecated: true, + default: false # deprecated property :clean_metadata, [TrueClass, FalseClass], - description: "Specifies whether you want to purge all of the packages downloaded from a Yum repository and held in a cache directory.", - default: true + description: "Specifies whether you want to purge all of the packages downloaded from a Yum repository and held in a cache directory.", + default: true property :cost, String, regex: /^\d+$/, description: "Relative cost of accessing this repository. Useful for weighing one repo's packages as greater/less than any other.", validation_message: "The cost property must be a numeric value!" property :description, String, - description: "Descriptive name for the repository channel and maps to the 'name' parameter in a repository .conf.", - default: "Yum Repository" + description: "Descriptive name for the repository channel and maps to the 'name' parameter in a repository .conf.", + default: "Yum Repository" property :enabled, [TrueClass, FalseClass], - description: "Specifies whether or not Yum should use this repository.", - default: true + description: "Specifies whether or not Yum should use this repository.", + default: true property :enablegroups, [TrueClass, FalseClass], - description: "Specifies whether Yum will allow the use of package groups for this repository." + description: "Specifies whether Yum will allow the use of package groups for this repository." property :exclude, String, - description: "List of packages to exclude from updates or installs. This should be a space separated list. Shell globs using wildcards (eg. * and ?) are allowed." + description: "List of packages to exclude from updates or installs. This should be a space separated list. Shell globs using wildcards (eg. * and ?) are allowed." property :failovermethod, String, - description: "Method to determine how to switch to a new server if the current one fails, which can either be ``roundrobin`` or ``priority``. ``roundrobin`` randomly selects a URL out of the list of URLs to start with and proceeds through each of them as it encounters a failure contacting the host. ``priority`` starts from the first ``baseurl`` listed and reads through them sequentially.", - equal_to: %w{priority roundrobin} + description: "Method to determine how to switch to a new server if the current one fails, which can either be ``roundrobin`` or ``priority``. ``roundrobin`` randomly selects a URL out of the list of URLs to start with and proceeds through each of them as it encounters a failure contacting the host. ``priority`` starts from the first ``baseurl`` listed and reads through them sequentially.", + equal_to: %w{priority roundrobin} property :fastestmirror_enabled, [TrueClass, FalseClass], - description: "Specifies whether to use the fastest mirror from a repository configuration when more than one mirror is listed in that configuration." + description: "Specifies whether to use the fastest mirror from a repository configuration when more than one mirror is listed in that configuration." property :gpgcheck, [TrueClass, FalseClass], - description: "Specifies whether or not Yum should perform a GPG signature check on the packages received from a repository.", - default: true + description: "Specifies whether or not Yum should perform a GPG signature check on the packages received from a repository.", + default: true property :gpgkey, [String, Array], - description: "URL pointing to the ASCII-armored GPG key file for the repository. This is used if Yum needs a public key to verify a package and the required key hasn't been imported into the RPM database. If this option is set, Yum will automatically import the key from the specified URL. Multiple URLs may be specified in the same manner as the baseurl option. If a GPG key is required to install a package from a repository, all keys specified for that repository will be installed.\nMultiple URLs may be specified in the same manner as the baseurl option. If a GPG key is required to install a package from a repository, all keys specified for that repository will be installed." + description: "URL pointing to the ASCII-armored GPG key file for the repository. This is used if Yum needs a public key to verify a package and the required key hasn't been imported into the RPM database. If this option is set, Yum will automatically import the key from the specified URL. Multiple URLs may be specified in the same manner as the baseurl option. If a GPG key is required to install a package from a repository, all keys specified for that repository will be installed.\nMultiple URLs may be specified in the same manner as the baseurl option. If a GPG key is required to install a package from a repository, all keys specified for that repository will be installed." property :http_caching, String, equal_to: %w{packages all none}, description: "Determines how upstream HTTP caches are instructed to handle any HTTP downloads that Yum does. This option can take the following values: all (all HTTP downloads should be cached), packages (only RPM package downloads should be cached, but not repository metadata downloads), or none (no HTTP downloads should be cached)" property :include_config, String, - description: "An external configuration file using the format 'url://to/some/location'." + description: "An external configuration file using the format 'url://to/some/location'." property :includepkgs, String, - description: "Inverse of exclude property. This is a list of packages you want to use from a repository. If this option lists only one package then that is all Yum will ever see from the repository." + description: "Inverse of exclude property. This is a list of packages you want to use from a repository. If this option lists only one package then that is all Yum will ever see from the repository." property :keepalive, [TrueClass, FalseClass], - description: "Determines whether or not HTTP/1.1 ``keep-alive`` should be used with this repository." + description: "Determines whether or not HTTP/1.1 ``keep-alive`` should be used with this repository." property :make_cache, [TrueClass, FalseClass], - description: "Determines whether package files downloaded by Yum stay in cache directories. By using cached data, you can carry out certain operations without a network connection.", - default: true + description: "Determines whether package files downloaded by Yum stay in cache directories. By using cached data, you can carry out certain operations without a network connection.", + default: true property :max_retries, [String, Integer], - description: "Number of times any attempt to retrieve a file should retry before returning an error. Setting this to '0' makes Yum try forever." + description: "Number of times any attempt to retrieve a file should retry before returning an error. Setting this to '0' makes Yum try forever." property :metadata_expire, String, regex: [/^\d+$/, /^\d+[mhd]$/, /never/], description: "Time (in seconds) after which the metadata will expire. If the current metadata downloaded is less than the value specified, then Yum will not update the metadata against the repository. If you find that Yum is not downloading information on updates as often as you would like lower the value of this option. You can also change from the default of using seconds to using days, hours or minutes by appending a 'd', 'h' or 'm' respectively. The default is six hours to compliment yum-updates running once per hour. It is also possible to use the word ``never``, meaning that the metadata will never expire. Note: When using a metalink file, the metalink must always be newer than the metadata for the repository due to the validation, so this timeout also applies to the metalink file.", validation_message: "The metadata_expire property must be a numeric value for time in seconds, the string 'never', or a numeric value appended with with 'd', 'h', or 'm'!" property :metalink, String, - description: "Specifies a URL to a metalink file for the repomd.xml, a list of mirrors for the entire repository are generated by converting the mirrors for the repomd.xml file to a baseurl." + description: "Specifies a URL to a metalink file for the repomd.xml, a list of mirrors for the entire repository are generated by converting the mirrors for the repomd.xml file to a baseurl." property :mirror_expire, String, regex: [/^\d+$/, /^\d+[mhd]$/], description: "Time (in seconds) after which the mirrorlist locally cached will expire. If the current mirrorlist is less than this many seconds old then Yum will not download another copy of the mirrorlist, it has the same extra format as metadata_expire. If you find that Yum is not downloading the mirrorlists as often as you would like lower the value of this option. You can also change from the default of using seconds to using days, hours or minutes by appending a 'd', 'h' or 'm' respectively.", @@ -111,36 +111,36 @@ class Chef validation_message: "The mirrorlist_expire property must be a numeric value for time in seconds, the string 'never', or a numeric value appended with with 'd', 'h', or 'm'!" property :mirrorlist, String, - description: "URL to a file containing a list of baseurls. This can be used instead of or with the baseurl option. Substitution variables, described below, can be used with this option." + description: "URL to a file containing a list of baseurls. This can be used instead of or with the baseurl option. Substitution variables, described below, can be used with this option." property :mode, [String, Integer], - description: "Permissions mode of .repo file on disk. This is useful for scenarios where secrets are in the repo file. If this value is set to '600', normal users will not be able to use Yum search, Yum info, etc.", - default: "0644" + description: "Permissions mode of .repo file on disk. This is useful for scenarios where secrets are in the repo file. If this value is set to '600', normal users will not be able to use Yum search, Yum info, etc.", + default: "0644" property :options, Hash, - description: "Specifies the repository options." + description: "Specifies the repository options." property :password, String, - description: "Password to use with the username for basic authentication." + description: "Password to use with the username for basic authentication." property :priority, String, regex: /^(\d?[1-9]|[0-9][0-9])$/, description: "Assigns a priority to a repository where the priority value is between '1' and '99' inclusive. Priorities are used to enforce ordered protection of repositories. Packages from repositories with a lower priority (higher numerical value) will never be used to upgrade packages that were installed from a repository with a higher priority (lower numerical value). The repositories with the lowest numerical priority number have the highest priority.", validation_message: "The priority property must be a numeric value from 1-99!" property :proxy_password, String, - description: "Password for this proxy." + description: "Password for this proxy." property :proxy_username, String, - description: "Username to use for proxy." + description: "Username to use for proxy." property :proxy, String, - description: "URL to the proxy server that Yum should use." + description: "URL to the proxy server that Yum should use." property :repo_gpgcheck, [TrueClass, FalseClass], - description: "Determines whether or not Yum should perform a GPG signature check on the repodata from this repository." + description: "Determines whether or not Yum should perform a GPG signature check on the repodata from this repository." property :report_instanceid, [TrueClass, FalseClass], - description: "Determines whether to report the instance ID when using Amazon Linux AMIs and repositories." + description: "Determines whether to report the instance ID when using Amazon Linux AMIs and repositories." property :repositoryid, String, regex: [/^[^\/]+$/], description: "An optional property to set the repository name if it differs from the resource block's name.", @@ -148,32 +148,32 @@ class Chef name_property: true property :skip_if_unavailable, [TrueClass, FalseClass], - description: "Allow yum to continue if this repository cannot be contacted for any reason." + description: "Allow yum to continue if this repository cannot be contacted for any reason." property :source, String, - description: "Use a custom template source instead of the default one." + description: "Use a custom template source instead of the default one." property :sslcacert, String, - description: "Path to the directory containing the databases of the certificate authorities Yum should use to verify SSL certificates." + description: "Path to the directory containing the databases of the certificate authorities Yum should use to verify SSL certificates." property :sslclientcert, String, - description: "Path to the SSL client certificate Yum should use to connect to repos/remote sites." + description: "Path to the SSL client certificate Yum should use to connect to repos/remote sites." property :sslclientkey, String, - description: "Path to the SSL client key Yum should use to connect to repos/remote sites." + description: "Path to the SSL client key Yum should use to connect to repos/remote sites." property :sslverify, [TrueClass, FalseClass], - description: "Determines whether Yum will verify SSL certificates/hosts." + description: "Determines whether Yum will verify SSL certificates/hosts." property :throttle, [String, Integer], - description: "Enable bandwidth throttling for downloads." + description: "Enable bandwidth throttling for downloads." property :timeout, String, regex: /^\d+$/, description: "Number of seconds to wait for a connection before timing out. Defaults to 30 seconds. This may be too short of a time for extremely overloaded sites.", validation_message: "The timeout property must be a numeric value!" property :username, String, - description: "Username to use for basic authentication to a repository." + description: "Username to use for basic authentication to a repository." default_action :create allowed_actions :create, :remove, :makecache, :add, :delete diff --git a/lib/chef/resource/zypper_package.rb b/lib/chef/resource/zypper_package.rb index f3b19846dc..3e4bff4cd7 100644 --- a/lib/chef/resource/zypper_package.rb +++ b/lib/chef/resource/zypper_package.rb @@ -28,19 +28,19 @@ class Chef description "Use the zypper_package resource to install, upgrade, and remove packages with Zypper for the SUSE Enterprise and OpenSUSE platforms." property :gpg_check, [ TrueClass, FalseClass ], - description: "Verify the package's GPG signature. Can also be controlled site-wide using the ``zypper_check_gpg`` config option.", - default: lazy { Chef::Config[:zypper_check_gpg] }, default_description: "true" + description: "Verify the package's GPG signature. Can also be controlled site-wide using the ``zypper_check_gpg`` config option.", + default: lazy { Chef::Config[:zypper_check_gpg] }, default_description: "true" property :allow_downgrade, [ TrueClass, FalseClass ], - description: "Allow downgrading a package to satisfy requested version requirements.", - default: true, - desired_state: false, - introduced: "13.6" + description: "Allow downgrading a package to satisfy requested version requirements.", + default: true, + desired_state: false, + introduced: "13.6" property :global_options, [ String, Array ], - description: "One (or more) additional command options that are passed to the command. For example, common zypper directives, such as '--no-recommends'. See the zypper man page at https://en.opensuse.org/SDB:Zypper_manual_(plain) for the full list.", - coerce: proc { |x| x.is_a?(String) ? x.shellsplit : x }, - introduced: "14.6" + description: "One (or more) additional command options that are passed to the command. For example, common zypper directives, such as '--no-recommends'. See the zypper man page at https://en.opensuse.org/SDB:Zypper_manual_(plain) for the full list.", + coerce: proc { |x| x.is_a?(String) ? x.shellsplit : x }, + introduced: "14.6" end end end diff --git a/lib/chef/resource/zypper_repository.rb b/lib/chef/resource/zypper_repository.rb index f6e6529023..92ab012c66 100644 --- a/lib/chef/resource/zypper_repository.rb +++ b/lib/chef/resource/zypper_repository.rb @@ -29,68 +29,68 @@ class Chef introduced "13.3" property :repo_name, String, - regex: [/^[^\/]+$/], - description: "An optional property to set the repository name if it differs from the resource block's name.", - validation_message: "repo_name property cannot contain a forward slash '/'", - name_property: true + regex: [/^[^\/]+$/], + description: "An optional property to set the repository name if it differs from the resource block's name.", + validation_message: "repo_name property cannot contain a forward slash '/'", + name_property: true property :description, String, - description: "The description of the repository that will be shown by the 'zypper repos' command." + description: "The description of the repository that will be shown by the 'zypper repos' command." property :type, String, - description: "Specifies the repository type.", - default: "NONE" + description: "Specifies the repository type.", + default: "NONE" property :enabled, [TrueClass, FalseClass], - description: "Determines whether or not the repository should be enabled.", - default: true + description: "Determines whether or not the repository should be enabled.", + default: true property :autorefresh, [TrueClass, FalseClass], - description: "Determines whether or not the repository should be refreshed automatically.", - default: true + description: "Determines whether or not the repository should be refreshed automatically.", + default: true property :gpgcheck, [TrueClass, FalseClass], - description: "Determines whether or not to perform a GPG signature check on the repository.", - default: true + description: "Determines whether or not to perform a GPG signature check on the repository.", + default: true property :gpgkey, String, - description: "The location of the repository key to be imported." + description: "The location of the repository key to be imported." property :baseurl, String, - description: "The base URL for the Zypper repository, such as 'http://download.opensuse.org'." + description: "The base URL for the Zypper repository, such as 'http://download.opensuse.org'." property :mirrorlist, String, - description: "The URL of the mirror list that will be used." + description: "The URL of the mirror list that will be used." property :path, String, - description: "The relative path from the repository's base URL." + description: "The relative path from the repository's base URL." property :priority, Integer, - description: "Determines the priority of the Zypper repository. ", - default: 99 + description: "Determines the priority of the Zypper repository. ", + default: 99 property :keeppackages, [TrueClass, FalseClass], - description: "Determines whether or not packages should be saved.", - default: false + description: "Determines whether or not packages should be saved.", + default: false property :mode, [String, Integer], - description: "The file mode of the repository file.", - default: "0644" + description: "The file mode of the repository file.", + default: "0644" property :refresh_cache, [TrueClass, FalseClass], - description: "Determines whether or not the package cache should be refreshed.", - default: true + description: "Determines whether or not the package cache should be refreshed.", + default: true property :source, String, - description: "The name of the template for the repository file. Only necessary if you're not using the built in template." + description: "The name of the template for the repository file. Only necessary if you're not using the built in template." property :cookbook, String, - description: "The cookbook to source the repository template file from. Only necessary if you're not using the built in template.", - desired_state: false + description: "The cookbook to source the repository template file from. Only necessary if you're not using the built in template.", + desired_state: false property :gpgautoimportkeys, [TrueClass, FalseClass], - description: "Automatically import the specified key when setting up the repository.", - default: true + description: "Automatically import the specified key when setting up the repository.", + default: true default_action :create allowed_actions :create, :remove, :add, :refresh diff --git a/lib/chef/resource_collection/resource_set.rb b/lib/chef/resource_collection/resource_set.rb index 62c18d07b0..b1c980dbc1 100644 --- a/lib/chef/resource_collection/resource_set.rb +++ b/lib/chef/resource_collection/resource_set.rb @@ -127,10 +127,10 @@ class Chef true when String raise Chef::Exceptions::InvalidResourceSpecification, - "The string `#{query_object}' is not valid for resource collection lookup. Correct syntax is `resource_type[resource_name]'" + "The string `#{query_object}' is not valid for resource collection lookup. Correct syntax is `resource_type[resource_name]'" else raise Chef::Exceptions::InvalidResourceSpecification, - "The object `#{query_object.inspect}' is not valid for resource collection lookup. " + + "The object `#{query_object.inspect}' is not valid for resource collection lookup. " + "Use a String like `resource_type[resource_name]' or a Chef::Resource object" end end diff --git a/lib/chef/user.rb b/lib/chef/user.rb index 946ab49a83..99ade65150 100644 --- a/lib/chef/user.rb +++ b/lib/chef/user.rb @@ -54,27 +54,27 @@ class Chef def name(arg = nil) set_or_return(:name, arg, - regex: /^[a-z0-9\-_]+$/) + regex: /^[a-z0-9\-_]+$/) end def admin(arg = nil) set_or_return(:admin, - arg, kind_of: [TrueClass, FalseClass]) + arg, kind_of: [TrueClass, FalseClass]) end def public_key(arg = nil) set_or_return(:public_key, - arg, kind_of: String) + arg, kind_of: String) end def private_key(arg = nil) set_or_return(:private_key, - arg, kind_of: String) + arg, kind_of: String) end def password(arg = nil) set_or_return(:password, - arg, kind_of: String) + arg, kind_of: String) end def to_h diff --git a/lib/chef/user_v1.rb b/lib/chef/user_v1.rb index a31f55279c..015beb371b 100644 --- a/lib/chef/user_v1.rb +++ b/lib/chef/user_v1.rb @@ -64,52 +64,52 @@ class Chef def username(arg = nil) set_or_return(:username, arg, - regex: /^[a-z0-9\-_]+$/) + regex: /^[a-z0-9\-_]+$/) end def display_name(arg = nil) set_or_return(:display_name, - arg, kind_of: String) + arg, kind_of: String) end def first_name(arg = nil) set_or_return(:first_name, - arg, kind_of: String) + arg, kind_of: String) end def middle_name(arg = nil) set_or_return(:middle_name, - arg, kind_of: String) + arg, kind_of: String) end def last_name(arg = nil) set_or_return(:last_name, - arg, kind_of: String) + arg, kind_of: String) end def email(arg = nil) set_or_return(:email, - arg, kind_of: String) + arg, kind_of: String) end def create_key(arg = nil) set_or_return(:create_key, arg, - kind_of: [TrueClass, FalseClass]) + kind_of: [TrueClass, FalseClass]) end def public_key(arg = nil) set_or_return(:public_key, - arg, kind_of: String) + arg, kind_of: String) end def private_key(arg = nil) set_or_return(:private_key, - arg, kind_of: String) + arg, kind_of: String) end def password(arg = nil) set_or_return(:password, - arg, kind_of: String) + arg, kind_of: String) end def to_h diff --git a/lib/chef/util/dsc/resource_store.rb b/lib/chef/util/dsc/resource_store.rb index 8aab2783ed..d064a397c3 100644 --- a/lib/chef/util/dsc/resource_store.rb +++ b/lib/chef/util/dsc/resource_store.rb @@ -84,7 +84,7 @@ class Chef # Returns a list of dsc resources def query_resources cmdlet = Chef::Util::Powershell::Cmdlet.new(nil, "get-dscresource", - :object) + :object) result = cmdlet.run result.return_value end @@ -92,7 +92,7 @@ class Chef # Returns a list of dsc resources matching the provided name def query_resource(resource_name) cmdlet = Chef::Util::Powershell::Cmdlet.new(nil, "get-dscresource #{resource_name}", - :object) + :object) result = cmdlet.run ret_val = result.return_value if ret_val.nil? diff --git a/lib/chef/util/windows/net_user.rb b/lib/chef/util/windows/net_user.rb index b60ffdc075..615e666b66 100644 --- a/lib/chef/util/windows/net_user.rb +++ b/lib/chef/util/windows/net_user.rb @@ -95,7 +95,7 @@ class Chef::Util::Windows::NetUser < Chef::Util::Windows # XXX for an extra painful alternative, see: http://support.microsoft.com/kb/180548 def validate_credentials(passwd) token = Security.logon_user(@username, nil, passwd, - LOGON32_LOGON_NETWORK, LOGON32_PROVIDER_DEFAULT) + LOGON32_LOGON_NETWORK, LOGON32_PROVIDER_DEFAULT) true rescue Chef::Exceptions::Win32APIError => e Chef::Log.trace(e) diff --git a/lib/chef/win32/api/crypto.rb b/lib/chef/win32/api/crypto.rb index ffd5d2e841..1b73ac65d1 100644 --- a/lib/chef/win32/api/crypto.rb +++ b/lib/chef/win32/api/crypto.rb @@ -35,8 +35,8 @@ class Chef CRYPTPROTECT_AUDIT = 0x10 class CRYPT_INTEGER_BLOB < FFI::Struct - layout :cbData, :DWORD, # Count, in bytes, of data - :pbData, :pointer # Pointer to data buffer + layout :cbData, :DWORD, # Count, in bytes, of data + :pbData, :pointer # Pointer to data buffer def initialize(str = nil) super(nil) if str diff --git a/lib/chef/win32/api/file.rb b/lib/chef/win32/api/file.rb index e09fdd0ae4..eea46ce87d 100644 --- a/lib/chef/win32/api/file.rb +++ b/lib/chef/win32/api/file.rb @@ -189,7 +189,7 @@ class Chef # see https://msdn.microsoft.com/en-us/library/windows/desktop/ms647464(v=vs.85).aspx class Translation < FFI::Struct layout :w_lang, :WORD, - :w_code_page, :WORD + :w_code_page, :WORD end =begin @@ -200,7 +200,7 @@ typedef struct _FILETIME { =end class FILETIME < FFI::Struct layout :dw_low_date_time, :DWORD, - :dw_high_date_time, :DWORD + :dw_high_date_time, :DWORD end =begin @@ -212,8 +212,8 @@ typedef struct _SECURITY_ATTRIBUTES { =end class SECURITY_ATTRIBUTES < FFI::Struct layout :n_length, :DWORD, - :lp_security_descriptor, :LPVOID, - :b_inherit_handle, :DWORD + :lp_security_descriptor, :LPVOID, + :b_inherit_handle, :DWORD end =begin @@ -232,15 +232,15 @@ typedef struct _WIN32_FIND_DATA { =end class WIN32_FIND_DATA < FFI::Struct layout :dw_file_attributes, :DWORD, - :ft_creation_time, FILETIME, - :ft_last_access_time, FILETIME, - :ft_last_write_time, FILETIME, - :n_file_size_high, :DWORD, - :n_file_size_low, :DWORD, - :dw_reserved_0, :DWORD, - :dw_reserved_1, :DWORD, - :c_file_name, [:BYTE, MAX_PATH * 2], - :c_alternate_file_name, [:BYTE, 14] + :ft_creation_time, FILETIME, + :ft_last_access_time, FILETIME, + :ft_last_write_time, FILETIME, + :n_file_size_high, :DWORD, + :n_file_size_low, :DWORD, + :dw_reserved_0, :DWORD, + :dw_reserved_1, :DWORD, + :c_file_name, [:BYTE, MAX_PATH * 2], + :c_alternate_file_name, [:BYTE, 14] end =begin @@ -259,15 +259,15 @@ typedef struct _BY_HANDLE_FILE_INFORMATION { =end class BY_HANDLE_FILE_INFORMATION < FFI::Struct layout :dw_file_attributes, :DWORD, - :ft_creation_time, FILETIME, - :ft_last_access_time, FILETIME, - :ft_last_write_time, FILETIME, - :dw_volume_serial_number, :DWORD, - :n_file_size_high, :DWORD, - :n_file_size_low, :DWORD, - :n_number_of_links, :DWORD, - :n_file_index_high, :DWORD, - :n_file_index_low, :DWORD + :ft_creation_time, FILETIME, + :ft_last_access_time, FILETIME, + :ft_last_write_time, FILETIME, + :dw_volume_serial_number, :DWORD, + :n_file_size_high, :DWORD, + :n_file_size_low, :DWORD, + :n_number_of_links, :DWORD, + :n_file_index_high, :DWORD, + :n_file_index_low, :DWORD end =begin @@ -563,7 +563,7 @@ BOOL WINAPI VerQueryValue( def file_handle(path) path = canonical_encode_path(path) handle = CreateFileW(path, GENERIC_READ, FILE_SHARE_READ, - nil, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_BACKUP_SEMANTICS, nil) + nil, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_BACKUP_SEMANTICS, nil) if handle == INVALID_HANDLE_VALUE Chef::ReservedNames::Win32::Error.raise! @@ -577,7 +577,7 @@ BOOL WINAPI VerQueryValue( def symlink_file_handle(path) path = encode_path(path) handle = CreateFileW(path, FILE_READ_EA, FILE_SHARE_READ, - nil, OPEN_EXISTING, FILE_FLAG_OPEN_REPARSE_POINT | FILE_FLAG_BACKUP_SEMANTICS, nil) + nil, OPEN_EXISTING, FILE_FLAG_OPEN_REPARSE_POINT | FILE_FLAG_BACKUP_SEMANTICS, nil) if handle == INVALID_HANDLE_VALUE Chef::ReservedNames::Win32::Error.raise! diff --git a/lib/chef/win32/api/net.rb b/lib/chef/win32/api/net.rb index df4411b429..392a442962 100644 --- a/lib/chef/win32/api/net.rb +++ b/lib/chef/win32/api/net.rb @@ -146,7 +146,7 @@ class Chef class LOCALGROUP_INFO_1 < FFI::Struct layout :lgrpi1_name, :LPWSTR, - :lgrpi1_comment, :LPWSTR + :lgrpi1_comment, :LPWSTR end class USE_INFO_2 < FFI::Struct diff --git a/lib/chef/win32/api/security.rb b/lib/chef/win32/api/security.rb index b6b54a63d5..a856fbd0a1 100644 --- a/lib/chef/win32/api/security.rb +++ b/lib/chef/win32/api/security.rb @@ -326,24 +326,24 @@ class Chef # http://msdn.microsoft.com/en-us/library/windows/desktop/aa374931(v=VS.85).aspx class ACLStruct < FFI::Struct layout :AclRevision, :uchar, - :Sbzl, :uchar, - :AclSize, :ushort, - :AceCount, :ushort, - :Sbz2, :ushort + :Sbzl, :uchar, + :AclSize, :ushort, + :AceCount, :ushort, + :Sbz2, :ushort end class ACE_HEADER < FFI::Struct layout :AceType, :uchar, - :AceFlags, :uchar, - :AceSize, :ushort + :AceFlags, :uchar, + :AceSize, :ushort end class ACE_WITH_MASK_AND_SID < FFI::Struct layout :AceType, :uchar, - :AceFlags, :uchar, - :AceSize, :ushort, - :Mask, :uint32, - :SidStart, :uint32 + :AceFlags, :uchar, + :AceSize, :ushort, + :Mask, :uint32, + :SidStart, :uint32 # The AceTypes this structure supports def self.supports?(ace_type) @@ -358,12 +358,12 @@ class Chef class LUID < FFI::Struct layout :LowPart, :DWORD, - :HighPart, :LONG + :HighPart, :LONG end class LUID_AND_ATTRIBUTES < FFI::Struct layout :Luid, LUID, - :Attributes, :DWORD + :Attributes, :DWORD end class GENERIC_MAPPING < FFI::Struct @@ -375,13 +375,13 @@ class Chef class PRIVILEGE_SET < FFI::Struct layout :PrivilegeCount, :DWORD, - :Control, :DWORD, - :Privilege, [LUID_AND_ATTRIBUTES, 1] + :Control, :DWORD, + :Privilege, [LUID_AND_ATTRIBUTES, 1] end class TOKEN_PRIVILEGES < FFI::Struct layout :PrivilegeCount, :DWORD, - :Privileges, LUID_AND_ATTRIBUTES + :Privileges, LUID_AND_ATTRIBUTES def self.size_with_privileges(num_privileges) offset_of(:Privileges) + LUID_AND_ATTRIBUTES.size * num_privileges @@ -399,18 +399,18 @@ class Chef # https://msdn.microsoft.com/en-us/library/windows/desktop/ms721829(v=vs.85).aspx class LSA_OBJECT_ATTRIBUTES < FFI::Struct layout :Length, :ULONG, - :RootDirectory, :HANDLE, - :ObjectName, :pointer, - :Attributes, :ULONG, - :SecurityDescriptor, :PVOID, - :SecurityQualityOfService, :PVOID + :RootDirectory, :HANDLE, + :ObjectName, :pointer, + :Attributes, :ULONG, + :SecurityDescriptor, :PVOID, + :SecurityQualityOfService, :PVOID end # https://msdn.microsoft.com/en-us/library/windows/desktop/ms721841(v=vs.85).aspx class LSA_UNICODE_STRING < FFI::Struct layout :Length, :USHORT, - :MaximumLength, :USHORT, - :Buffer, :PWSTR + :MaximumLength, :USHORT, + :Buffer, :PWSTR end ffi_lib "advapi32" diff --git a/lib/chef/win32/file.rb b/lib/chef/win32/file.rb index 101680fc90..274879a32d 100644 --- a/lib/chef/win32/file.rb +++ b/lib/chef/win32/file.rb @@ -190,7 +190,7 @@ class Chef mapping[:GenericAll] = Chef::ReservedNames::Win32::Security::FILE_ALL_ACCESS Chef::ReservedNames::Win32::Security.access_check(security_descriptor, duplicate_token, - desired_access, mapping) + desired_access, mapping) end def self.delete_volume_mount_point(mount_point) diff --git a/lib/chef/win32/security.rb b/lib/chef/win32/security.rb index 6d9d359130..9a97fd77d2 100644 --- a/lib/chef/win32/security.rb +++ b/lib/chef/win32/security.rb @@ -56,8 +56,8 @@ class Chef granted_access_ptr = FFI::MemoryPointer.new(:ulong) unless AccessCheck(security_descriptor_ptr, token_handle, rights_ptr.read_ulong, - generic_mapping, privileges, privileges_length_ptr, granted_access_ptr, - result_ptr) + generic_mapping, privileges, privileges_length_ptr, granted_access_ptr, + result_ptr) Chef::ReservedNames::Win32::Error.raise! end result_ptr.read_ulong == 1 diff --git a/spec/functional/dsl/reboot_pending_spec.rb b/spec/functional/dsl/reboot_pending_spec.rb index 899106b4b8..855a38b9cf 100644 --- a/spec/functional/dsl/reboot_pending_spec.rb +++ b/spec/functional/dsl/reboot_pending_spec.rb @@ -47,7 +47,7 @@ describe Chef::DSL::RebootPending, :windows_only do it "returns true if the registry value exists" do skip "found existing registry key" if original_set registry.set_value(reg_key, - { name: "PendingFileRenameOperations", type: :multi_string, data: ['\??\C:\foo.txt|\??\C:\bar.txt'] }) + { name: "PendingFileRenameOperations", type: :multi_string, data: ['\??\C:\foo.txt|\??\C:\bar.txt'] }) expect(recipe.reboot_pending?).to be_truthy end diff --git a/spec/functional/resource/git_spec.rb b/spec/functional/resource/git_spec.rb index 67021f6901..e978041038 100644 --- a/spec/functional/resource/git_spec.rb +++ b/spec/functional/resource/git_spec.rb @@ -220,7 +220,7 @@ describe Chef::Resource::Git, requires_git: true do context "when dealing with a repo with a degenerate tag named 'HEAD'" do before do shell_out!("git tag -m\"degenerate tag\" HEAD ed181b3419b6f489bedab282348162a110d6d3a1", - cwd: origin_repo) + cwd: origin_repo) end let(:basic_git_resource) do @@ -240,16 +240,16 @@ describe Chef::Resource::Git, requires_git: true do it "checks out the (master) HEAD revision and ignores the tag" do basic_git_resource.run_action(:sync) head_rev = shell_out!("git rev-parse HEAD", - cwd: deploy_directory, - returns: [0]).stdout.strip + cwd: deploy_directory, + returns: [0]).stdout.strip expect(head_rev).to eq(rev_head) end it "checks out the (master) HEAD revision when no revision is specified (ignores tag)" do git_resource_default_rev.run_action(:sync) head_rev = shell_out!("git rev-parse HEAD", - cwd: deploy_directory, - returns: [0]).stdout.strip + cwd: deploy_directory, + returns: [0]).stdout.strip expect(head_rev).to eq(rev_head) end diff --git a/spec/functional/win32/security_spec.rb b/spec/functional/win32/security_spec.rb index b3fe2afb31..92ce480d25 100644 --- a/spec/functional/win32/security_spec.rb +++ b/spec/functional/win32/security_spec.rb @@ -94,7 +94,7 @@ describe "Chef::Win32::Security", :windows_only do it "should check if the provided token has the desired access" do expect(Chef::ReservedNames::Win32::Security.access_check(security_descriptor, - token, desired_access, mapping)).to be true + token, desired_access, mapping)).to be true end end diff --git a/spec/unit/application/client_spec.rb b/spec/unit/application/client_spec.rb index df1b6c99e2..0773fc70fd 100644 --- a/spec/unit/application/client_spec.rb +++ b/spec/unit/application/client_spec.rb @@ -120,8 +120,8 @@ describe Chef::Application::Client, "reconfigure" do describe "--named-run-list" do it_behaves_like "sets the configuration", - "--named-run-list arglebargle-example", - named_run_list: "arglebargle-example" + "--named-run-list arglebargle-example", + named_run_list: "arglebargle-example" end describe "--no-listen" do @@ -131,17 +131,17 @@ describe Chef::Application::Client, "reconfigure" do describe "--daemonize", :unix_only do context "with no value" do it_behaves_like "sets the configuration", "--daemonize", - daemonize: true + daemonize: true end context "with an integer value" do it_behaves_like "sets the configuration", "--daemonize 5", - daemonize: 5 + daemonize: 5 end context "with a non-integer value" do it_behaves_like "sets the configuration", "--daemonize foo", - daemonize: true + daemonize: true end end @@ -178,17 +178,17 @@ describe Chef::Application::Client, "reconfigure" do describe "--config-option" do context "with a single value" do it_behaves_like "sets the configuration", "--config-option chef_server_url=http://example", - chef_server_url: "http://example" + chef_server_url: "http://example" end context "with two values" do it_behaves_like "sets the configuration", "--config-option chef_server_url=http://example --config-option policy_name=web", - chef_server_url: "http://example", policy_name: "web" + chef_server_url: "http://example", policy_name: "web" end context "with a boolean value" do it_behaves_like "sets the configuration", "--config-option minimal_ohai=true", - minimal_ohai: true + minimal_ohai: true end context "with an empty value" do diff --git a/spec/unit/cookbook/synchronizer_spec.rb b/spec/unit/cookbook/synchronizer_spec.rb index dc68bf1824..0762a11771 100644 --- a/spec/unit/cookbook/synchronizer_spec.rb +++ b/spec/unit/cookbook/synchronizer_spec.rb @@ -199,22 +199,22 @@ describe Chef::CookbookSynchronizer do let(:cookbook_a_default_recipe_tempfile) do double("Tempfile for cookbook_a default.rb recipe", - path: "/tmp/cookbook_a_recipes_default_rb") + path: "/tmp/cookbook_a_recipes_default_rb") end let(:cookbook_a_default_attribute_tempfile) do double("Tempfile for cookbook_a default.rb attr file", - path: "/tmp/cookbook_a_attributes_default_rb") + path: "/tmp/cookbook_a_attributes_default_rb") end let(:cookbook_a_file_default_tempfile) do double("Tempfile for cookbook_a megaman.conf file", - path: "/tmp/cookbook_a_file_default_tempfile") + path: "/tmp/cookbook_a_file_default_tempfile") end let(:cookbook_a_template_default_tempfile) do double("Tempfile for cookbook_a apache.conf.erb template", - path: "/tmp/cookbook_a_template_default_tempfile") + path: "/tmp/cookbook_a_template_default_tempfile") end def setup_common_files_missing_expectations diff --git a/spec/unit/environment_spec.rb b/spec/unit/environment_spec.rb index aa4c105c3a..4da3a9fa0e 100644 --- a/spec/unit/environment_spec.rb +++ b/spec/unit/environment_spec.rb @@ -299,7 +299,7 @@ describe Chef::Environment do expect do Chef::Environment.validate_cookbook_version("= 1.2.3.4") end.to raise_error Chef::Exceptions::IllegalVersionConstraint, - /Environment cookbook version constraints not allowed in .*/ + /Environment cookbook version constraints not allowed in .*/ end end diff --git a/spec/unit/file_content_management/deploy/mv_unix_spec.rb b/spec/unit/file_content_management/deploy/mv_unix_spec.rb index a31074e4bd..491457e8c6 100644 --- a/spec/unit/file_content_management/deploy/mv_unix_spec.rb +++ b/spec/unit/file_content_management/deploy/mv_unix_spec.rb @@ -38,9 +38,9 @@ describe Chef::FileContentManagement::Deploy::MvUnix do let(:target_file_mode) { 0644 } let(:target_file_stat) do double "File::Stat struct for target file", - mode: target_file_mode, - uid: target_file_uid, - gid: target_file_gid + mode: target_file_mode, + uid: target_file_uid, + gid: target_file_gid end before do diff --git a/spec/unit/file_content_management/deploy/mv_windows_spec.rb b/spec/unit/file_content_management/deploy/mv_windows_spec.rb index 80155f131c..1aadf89d2d 100644 --- a/spec/unit/file_content_management/deploy/mv_windows_spec.rb +++ b/spec/unit/file_content_management/deploy/mv_windows_spec.rb @@ -84,8 +84,8 @@ describe Chef::FileContentManagement::Deploy::MvWindows do let(:target_file_security_descriptor) do double "security descriptor for target file", - group: original_target_file_group, - owner: original_target_file_owner + group: original_target_file_group, + owner: original_target_file_owner end let(:updated_target_security_descriptor) do diff --git a/spec/unit/key_spec.rb b/spec/unit/key_spec.rb index 63c5982137..e3d9f8e7ad 100644 --- a/spec/unit/key_spec.rb +++ b/spec/unit/key_spec.rb @@ -406,9 +406,9 @@ describe Chef::Key do it "creates a new key via the API with the fingerprint as the name" do expect(rest).to receive(:post).with(url, - { "name" => "12:3e:33:73:0b:f4:ec:72:dc:f0:4c:51:62:27:08:76:96:24:f4:4a", - "public_key" => key.public_key, - "expiration_date" => key.expiration_date }).and_return({}) + { "name" => "12:3e:33:73:0b:f4:ec:72:dc:f0:4c:51:62:27:08:76:96:24:f4:4a", + "public_key" => key.public_key, + "expiration_date" => key.expiration_date }).and_return({}) key.create end end @@ -424,9 +424,9 @@ describe Chef::Key do context "when create_key is false" do it "creates a new key via the API" do expect(rest).to receive(:post).with(url, - { "name" => key.name, - "public_key" => key.public_key, - "expiration_date" => key.expiration_date }).and_return({}) + { "name" => key.name, + "public_key" => key.public_key, + "expiration_date" => key.expiration_date }).and_return({}) key.create end end diff --git a/spec/unit/knife/bootstrap_spec.rb b/spec/unit/knife/bootstrap_spec.rb index bf2c7c4902..ee376e2bb4 100644 --- a/spec/unit/knife/bootstrap_spec.rb +++ b/spec/unit/knife/bootstrap_spec.rb @@ -33,9 +33,9 @@ describe Chef::Knife::Bootstrap do let(:connection) do double("TrainConnector", - windows?: windows_test, - linux?: linux_test, - unix?: unix_test) end + windows?: windows_test, + linux?: linux_test, + unix?: unix_test) end let(:knife) do Chef::Log.logger = Logger.new(StringIO.new) diff --git a/spec/unit/knife/cookbook_delete_spec.rb b/spec/unit/knife/cookbook_delete_spec.rb index f65a26c455..b2f17778cd 100644 --- a/spec/unit/knife/cookbook_delete_spec.rb +++ b/spec/unit/knife/cookbook_delete_spec.rb @@ -76,8 +76,8 @@ describe Chef::Knife::CookbookDelete do @knife.cookbook_name = "foobar" @knife.version = "1.0.0" expect(@knife).to receive(:delete_object).with(Chef::CookbookVersion, - "foobar version 1.0.0", - "cookbook").and_yield() + "foobar version 1.0.0", + "cookbook").and_yield() expect(@knife).to receive(:delete_request).with("cookbooks/foobar/1.0.0") @knife.delete_explicit_version end diff --git a/spec/unit/knife/core/hashed_command_loader_spec.rb b/spec/unit/knife/core/hashed_command_loader_spec.rb index e866f13a9c..c59838478e 100644 --- a/spec/unit/knife/core/hashed_command_loader_spec.rb +++ b/spec/unit/knife/core/hashed_command_loader_spec.rb @@ -43,8 +43,8 @@ describe Chef::Knife::SubcommandLoader::HashedCommandLoader do let(:loader) do Chef::Knife::SubcommandLoader::HashedCommandLoader.new( - File.join(CHEF_SPEC_DATA, "knife-site-subcommands"), - plugin_manifest) end + File.join(CHEF_SPEC_DATA, "knife-site-subcommands"), + plugin_manifest) end describe "#list_commands" do before do diff --git a/spec/unit/knife/raw_spec.rb b/spec/unit/knife/raw_spec.rb index 9202998fb9..d1300e9437 100644 --- a/spec/unit/knife/raw_spec.rb +++ b/spec/unit/knife/raw_spec.rb @@ -35,8 +35,8 @@ describe Chef::Knife::Raw do it "should set the x-ops-request-source header when --proxy-auth is set" do knife.config[:proxy_auth] = true expect(rest).to receive(:request).with(:GET, "/nodes", - { "Content-Type" => "application/json", - "x-ops-request-source" => "web" }, false) + { "Content-Type" => "application/json", + "x-ops-request-source" => "web" }, false) knife.run end end diff --git a/spec/unit/knife_spec.rb b/spec/unit/knife_spec.rb index 169265c52d..2c14e417b4 100644 --- a/spec/unit/knife_spec.rb +++ b/spec/unit/knife_spec.rb @@ -35,9 +35,9 @@ describe Chef::Knife do let(:config_loader) do instance_double("WorkstationConfigLoader", - load: nil, no_config_found?: false, - config_location: config_location, - chef_config_dir: "/etc/chef") + load: nil, no_config_found?: false, + config_location: config_location, + chef_config_dir: "/etc/chef") end before(:each) do @@ -285,8 +285,8 @@ describe Chef::Knife do before do KnifeSpecs::TestYourself.option(:opt_with_default, - short: "-D VALUE", - default: "default-value") + short: "-D VALUE", + default: "default-value") end # This supports a use case used by plugins, where the pattern # seems to follow: @@ -308,8 +308,8 @@ describe Chef::Knife do describe "merging configuration options" do before do KnifeSpecs::TestYourself.option(:opt_with_default, - short: "-D VALUE", - default: "default-value") + short: "-D VALUE", + default: "default-value") end it "sets the default log_location to STDERR for Chef::Log warnings" do diff --git a/spec/unit/mixin/params_validate_spec.rb b/spec/unit/mixin/params_validate_spec.rb index 62d6b3e117..1cc7fef58e 100644 --- a/spec/unit/mixin/params_validate_spec.rb +++ b/spec/unit/mixin/params_validate_spec.rb @@ -334,22 +334,22 @@ describe Chef::Mixin::ParamsValidate do it "asserts that a value returns false from a predicate method" do expect do @vo.validate({ not_blank: "should pass" }, - { not_blank: { cannot_be: [ :nil, :empty ] } }) + { not_blank: { cannot_be: [ :nil, :empty ] } }) end.not_to raise_error expect do @vo.validate({ not_blank: "" }, - { not_blank: { cannot_be: [ :nil, :empty ] } }) + { not_blank: { cannot_be: [ :nil, :empty ] } }) end.to raise_error(Chef::Exceptions::ValidationFailed) end it "allows a custom validation message" do expect do @vo.validate({ not_blank: "should pass" }, - { not_blank: { cannot_be: [ :nil, :empty ], validation_message: "my validation message" } }) + { not_blank: { cannot_be: [ :nil, :empty ], validation_message: "my validation message" } }) end.not_to raise_error expect do @vo.validate({ not_blank: "" }, - { not_blank: { cannot_be: [ :nil, :empty ], validation_message: "my validation message" } }) + { not_blank: { cannot_be: [ :nil, :empty ], validation_message: "my validation message" } }) end.to raise_error(Chef::Exceptions::ValidationFailed, "my validation message") end diff --git a/spec/unit/node/vivid_mash_spec.rb b/spec/unit/node/vivid_mash_spec.rb index cfdc813b50..575d8c3321 100644 --- a/spec/unit/node/vivid_mash_spec.rb +++ b/spec/unit/node/vivid_mash_spec.rb @@ -421,8 +421,8 @@ describe Chef::Node::AttrArray do context "#compact!" do it "VividMashes remain VividMashes" do array = Chef::Node::AttrArray.new( - [ nil, { "one" => "two" }, nil ], - root + [ nil, { "one" => "two" }, nil ], + root ) expect(array[1].class).to eql(Chef::Node::VividMash) array.compact! @@ -440,8 +440,8 @@ describe Chef::Node::AttrArray do context "#flatten!" do it "flattens sub-arrays maintaining VividMashes in them" do array = Chef::Node::AttrArray.new( - [ [ { "one" => "two" } ], [ { "one" => "two" } ] ], - root + [ [ { "one" => "two" } ], [ { "one" => "two" } ] ], + root ) expect(array[0][0].class).to eql(Chef::Node::VividMash) array.flatten! diff --git a/spec/unit/property/state_spec.rb b/spec/unit/property/state_spec.rb index be19dd7ec2..5c54ec71b2 100644 --- a/spec/unit/property/state_spec.rb +++ b/spec/unit/property/state_spec.rb @@ -254,8 +254,8 @@ describe "Chef::Resource#identity and #state" do end with_property ":x, identity: true, default: 'xxx'", - ":y, identity: true, default: 'yyy'", - ":z, identity: true, default: 'zzz'" do + ":y, identity: true, default: 'yyy'", + ":z, identity: true, default: 'zzz'" do it "identity_property raises an error if multiple identity values are defined" do expect { resource_class.identity_property }.to raise_error Chef::Exceptions::MultipleIdentityError end diff --git a/spec/unit/provider/dsc_resource_spec.rb b/spec/unit/provider/dsc_resource_spec.rb index 82ee5a40b3..6edf0963b8 100644 --- a/spec/unit/provider/dsc_resource_spec.rb +++ b/spec/unit/provider/dsc_resource_spec.rb @@ -36,7 +36,7 @@ describe Chef::Provider::DscResource do it "raises a ProviderNotFound exception" do expect(provider).not_to receive(:meta_configuration) expect { provider.run_action(:run) }.to raise_error( - Chef::Exceptions::ProviderNotFound, /5\.0\.10018\.0/) + Chef::Exceptions::ProviderNotFound, /5\.0\.10018\.0/) end end diff --git a/spec/unit/provider/git_spec.rb b/spec/unit/provider/git_spec.rb index b1409ee1f4..9a6ae31397 100644 --- a/spec/unit/provider/git_spec.rb +++ b/spec/unit/provider/git_spec.rb @@ -377,7 +377,7 @@ describe Chef::Provider::Git do version_response = double("shell_out") allow(version_response).to receive(:stdout) { "git version 1.7.9" } expect(@provider).to receive(:shell_out!).with("git --version", - log_tag: "git[web2.0 app]").and_return(version_response) + log_tag: "git[web2.0 app]").and_return(version_response) expect(@provider).to receive(:shell_out!).with(expected_cmd, log_tag: "git[web2.0 app]") @provider.clone end @@ -388,7 +388,7 @@ describe Chef::Provider::Git do version_response = double("shell_out") allow(version_response).to receive(:stdout) { "git version 1.7.10" } expect(@provider).to receive(:shell_out!).with("git --version", - log_tag: "git[web2.0 app]").and_return(version_response) + log_tag: "git[web2.0 app]").and_return(version_response) expect(@provider).to receive(:shell_out!).with(expected_cmd, log_tag: "git[web2.0 app]") @provider.clone end @@ -489,13 +489,13 @@ describe Chef::Provider::Git do allow(command_response).to receive(:exitstatus) { 1 } expected_command = "git config --get remote.#{@resource.remote}.url" expect(@provider).to receive(:shell_out!).with(expected_command, - cwd: "/my/deploy/dir", - log_tag: "git[web2.0 app]", - returns: [0, 1, 2]).and_return(command_response) + cwd: "/my/deploy/dir", + log_tag: "git[web2.0 app]", + returns: [0, 1, 2]).and_return(command_response) add_remote_command = "git remote add #{@resource.remote} #{@resource.repository}" expect(@provider).to receive(:shell_out!).with(add_remote_command, - cwd: "/my/deploy/dir", - log_tag: "git[web2.0 app]") + cwd: "/my/deploy/dir", + log_tag: "git[web2.0 app]") @provider.setup_remote_tracking_branches(@resource.remote, @resource.repository) end @@ -507,19 +507,19 @@ describe Chef::Provider::Git do allow(command_response).to receive(:exitstatus) { 1 } expected_command = "git config --get remote.#{@resource.remote}.url" expect(@provider).to receive(:shell_out!).with(expected_command, - cwd: "/my/deploy/dir", - log_tag: "git[web2.0 app]", - user: "whois", - group: "thisis", - environment: { "HOME" => "/home/whois" }, - returns: [0, 1, 2]).and_return(command_response) + cwd: "/my/deploy/dir", + log_tag: "git[web2.0 app]", + user: "whois", + group: "thisis", + environment: { "HOME" => "/home/whois" }, + returns: [0, 1, 2]).and_return(command_response) add_remote_command = "git remote add #{@resource.remote} #{@resource.repository}" expect(@provider).to receive(:shell_out!).with(add_remote_command, - cwd: "/my/deploy/dir", - log_tag: "git[web2.0 app]", - user: "whois", - group: "thisis", - environment: { "HOME" => "/home/whois" }) + cwd: "/my/deploy/dir", + log_tag: "git[web2.0 app]", + user: "whois", + group: "thisis", + environment: { "HOME" => "/home/whois" }) @provider.setup_remote_tracking_branches(@resource.remote, @resource.repository) end @@ -529,13 +529,13 @@ describe Chef::Provider::Git do allow(command_response).to receive(:exitstatus) { 1 } check_remote_command = "git config --get remote.#{@resource.remote}.url" expect(@provider).to receive(:shell_out!).with(check_remote_command, - cwd: "/my/deploy/dir", - log_tag: "git[web2.0 app]", - returns: [0, 1, 2]).and_return(command_response) + cwd: "/my/deploy/dir", + log_tag: "git[web2.0 app]", + returns: [0, 1, 2]).and_return(command_response) expected_command = "git remote add #{@resource.remote} #{@resource.repository}" expect(@provider).to receive(:shell_out!).with(expected_command, - cwd: "/my/deploy/dir", - log_tag: "git[web2.0 app]") + cwd: "/my/deploy/dir", + log_tag: "git[web2.0 app]") @provider.setup_remote_tracking_branches(@resource.remote, @resource.repository) end end @@ -547,13 +547,13 @@ describe Chef::Provider::Git do allow(command_response).to receive(:stdout) { "some_other_url" } check_remote_command = "git config --get remote.#{@resource.remote}.url" expect(@provider).to receive(:shell_out!).with(check_remote_command, - cwd: "/my/deploy/dir", - log_tag: "git[web2.0 app]", - returns: [0, 1, 2]).and_return(command_response) + cwd: "/my/deploy/dir", + log_tag: "git[web2.0 app]", + returns: [0, 1, 2]).and_return(command_response) expected_command = "git config --replace-all remote.#{@resource.remote}.url \"#{@resource.repository}\"" expect(@provider).to receive(:shell_out!).with(expected_command, - cwd: "/my/deploy/dir", - log_tag: "git[web2.0 app]") + cwd: "/my/deploy/dir", + log_tag: "git[web2.0 app]") @provider.setup_remote_tracking_branches(@resource.remote, @resource.repository) end @@ -563,13 +563,13 @@ describe Chef::Provider::Git do allow(command_response).to receive(:stdout) { @resource.repository } check_remote_command = "git config --get remote.#{@resource.remote}.url" expect(@provider).to receive(:shell_out!).with(check_remote_command, - cwd: "/my/deploy/dir", - log_tag: "git[web2.0 app]", - returns: [0, 1, 2]).and_return(command_response) + cwd: "/my/deploy/dir", + log_tag: "git[web2.0 app]", + returns: [0, 1, 2]).and_return(command_response) unexpected_command = "git config --replace-all remote.#{@resource.remote}.url \"#{@resource.repository}\"" expect(@provider).not_to receive(:shell_out!).with(unexpected_command, - cwd: "/my/deploy/dir", - log_tag: "git[web2.0 app]") + cwd: "/my/deploy/dir", + log_tag: "git[web2.0 app]") @provider.setup_remote_tracking_branches(@resource.remote, @resource.repository) end @@ -578,13 +578,13 @@ describe Chef::Provider::Git do allow(command_response).to receive(:exitstatus) { 2 } check_remote_command = "git config --get remote.#{@resource.remote}.url" expect(@provider).to receive(:shell_out!).with(check_remote_command, - cwd: "/my/deploy/dir", - log_tag: "git[web2.0 app]", - returns: [0, 1, 2]).and_return(command_response) + cwd: "/my/deploy/dir", + log_tag: "git[web2.0 app]", + returns: [0, 1, 2]).and_return(command_response) expected_command = "git config --replace-all remote.#{@resource.remote}.url \"#{@resource.repository}\"" expect(@provider).to receive(:shell_out!).with(expected_command, - cwd: "/my/deploy/dir", - log_tag: "git[web2.0 app]") + cwd: "/my/deploy/dir", + log_tag: "git[web2.0 app]") @provider.setup_remote_tracking_branches(@resource.remote, @resource.repository) end end diff --git a/spec/unit/provider/ohai_spec.rb b/spec/unit/provider/ohai_spec.rb index 518523dca2..11f11e3373 100644 --- a/spec/unit/provider/ohai_spec.rb +++ b/spec/unit/provider/ohai_spec.rb @@ -43,7 +43,7 @@ describe Chef::Provider::Ohai do } allow(mock_ohai).to receive(:all_plugins).and_return(true) allow(mock_ohai).to receive(:data).and_return(mock_ohai[:data], - mock_ohai[:data2]) + mock_ohai[:data2]) allow(Ohai::System).to receive(:new).and_return(mock_ohai) allow(Chef::Platform).to receive(:find_platform_and_version).and_return({ "platform" => @platform, "platform_version" => @platform_version }) diff --git a/spec/unit/provider/package/zypper_spec.rb b/spec/unit/provider/package/zypper_spec.rb index c17eeba1bb..a8ab2a0b37 100644 --- a/spec/unit/provider/package/zypper_spec.rb +++ b/spec/unit/provider/package/zypper_spec.rb @@ -223,7 +223,7 @@ describe Chef::Provider::Package::Zypper do context "when package version is not explicitly specified" do it "should run zypper remove with the package name" do shell_out_expectation!( - "zypper", "--non-interactive", "remove", "emacs" + "zypper", "--non-interactive", "remove", "emacs" ) provider.remove_package(["emacs"], [nil]) end @@ -239,14 +239,14 @@ describe Chef::Provider::Package::Zypper do it "should run zypper remove without gpg checks" do new_resource.gpg_check false shell_out_expectation!( - "zypper", "--non-interactive", "--no-gpg-checks", "remove", "emacs=1.0" + "zypper", "--non-interactive", "--no-gpg-checks", "remove", "emacs=1.0" ) provider.remove_package(["emacs"], ["1.0"]) end it "should run zypper remove without gpg checks when the config is false" do Chef::Config[:zypper_check_gpg] = false shell_out_expectation!( - "zypper", "--non-interactive", "--no-gpg-checks", "remove", "emacs=1.0" + "zypper", "--non-interactive", "--no-gpg-checks", "remove", "emacs=1.0" ) provider.remove_package(["emacs"], ["1.0"]) end @@ -453,7 +453,7 @@ describe Chef::Provider::Package::Zypper do describe "remove_package" do it "should run zypper remove with the package name" do shell_out_expectation!( - "zypper", "remove", "-y", "emacs" + "zypper", "remove", "-y", "emacs" ) provider.remove_package(["emacs"], ["1.0"]) end diff --git a/spec/unit/provider/remote_directory_spec.rb b/spec/unit/provider/remote_directory_spec.rb index d391da3010..f9559d8827 100644 --- a/spec/unit/provider/remote_directory_spec.rb +++ b/spec/unit/provider/remote_directory_spec.rb @@ -90,8 +90,8 @@ describe Chef::Provider::RemoteDirectory do it "configures access control on files in the directory" do @resource.cookbook "berlin_style_tasty_cupcakes" cookbook_file = @provider.send(:cookbook_file_resource, - "/target/destination/path.txt", - "relative/source/path.txt") + "/target/destination/path.txt", + "relative/source/path.txt") expect(cookbook_file.cookbook_name).to eq("berlin_style_tasty_cupcakes") expect(cookbook_file.source).to eq("remotedir_root/relative/source/path.txt") expect(cookbook_file.mode).to eq("0640") @@ -104,14 +104,14 @@ describe Chef::Provider::RemoteDirectory do @resource.cookbook "gondola_rides" @resource.sensitive true cookbook_file = @provider.send(:cookbook_file_resource, - "/target/destination/path.txt", - "relative/source/path.txt") + "/target/destination/path.txt", + "relative/source/path.txt") expect(cookbook_file.sensitive).to eq(true) @resource.sensitive false cookbook_file = @provider.send(:cookbook_file_resource, - "/target/destination/path.txt", - "relative/source/path.txt") + "/target/destination/path.txt", + "relative/source/path.txt") expect(cookbook_file.sensitive).to eq(false) end end diff --git a/spec/unit/provider/service/macosx_spec.rb b/spec/unit/provider/service/macosx_spec.rb index e11cf6154e..420fd329f6 100644 --- a/spec/unit/provider/service/macosx_spec.rb +++ b/spec/unit/provider/service/macosx_spec.rb @@ -85,7 +85,7 @@ describe Chef::Provider::Service::Macosx do allow(provider).to receive(:shell_out) .with(/(#{su_cmd} '#{cmd}'|#{cmd})/, default_env: false) .and_return(double("Status", - stdout: launchctl_stdout, exitstatus: 0)) + stdout: launchctl_stdout, exitstatus: 0)) allow(File).to receive(:exists?).and_return([true], []) allow(provider).to receive(:shell_out!) .with(/plutil -convert xml1 -o/, default_env: false) diff --git a/spec/unit/provider/template/content_spec.rb b/spec/unit/provider/template/content_spec.rb index 572cf23181..60ff18c123 100644 --- a/spec/unit/provider/template/content_spec.rb +++ b/spec/unit/provider/template/content_spec.rb @@ -30,20 +30,20 @@ describe Chef::Provider::Template::Content do let(:new_resource) do double("Chef::Resource::Template (new)", - cookbook_name: "openldap", - recipe_name: "default", - source_line: "/Users/lamont/solo/cookbooks/openldap/recipes/default.rb:2:in `from_file'", - source_line_file: "/Users/lamont/solo/cookbooks/openldap/recipes/default.rb", - source_line_number: "2", - source: "openldap_stuff.conf.erb", - name: "openldap_stuff.conf", - path: resource_path, - local: false, - cookbook: nil, - variables: {}, - inline_helper_blocks: {}, - inline_helper_modules: [], - helper_modules: []) + cookbook_name: "openldap", + recipe_name: "default", + source_line: "/Users/lamont/solo/cookbooks/openldap/recipes/default.rb:2:in `from_file'", + source_line_file: "/Users/lamont/solo/cookbooks/openldap/recipes/default.rb", + source_line_number: "2", + source: "openldap_stuff.conf.erb", + name: "openldap_stuff.conf", + path: resource_path, + local: false, + cookbook: nil, + variables: {}, + inline_helper_blocks: {}, + inline_helper_modules: [], + helper_modules: []) end let(:rendered_file_locations) do @@ -130,20 +130,20 @@ describe Chef::Provider::Template::Content do describe "when using location helpers" do let(:new_resource) do double("Chef::Resource::Template (new)", - cookbook_name: "openldap", - recipe_name: "default", - source_line: CHEF_SPEC_DATA + "/cookbooks/openldap/recipes/default.rb:2:in `from_file'", - source_line_file: CHEF_SPEC_DATA + "/cookbooks/openldap/recipes/default.rb", - source_line_number: "2", - source: "helpers.erb", - name: "helpers.erb", - path: CHEF_SPEC_DATA + "/cookbooks/openldap/templates/default/helpers.erb", - local: false, - cookbook: nil, - variables: {}, - inline_helper_blocks: {}, - inline_helper_modules: [], - helper_modules: []) + cookbook_name: "openldap", + recipe_name: "default", + source_line: CHEF_SPEC_DATA + "/cookbooks/openldap/recipes/default.rb:2:in `from_file'", + source_line_file: CHEF_SPEC_DATA + "/cookbooks/openldap/recipes/default.rb", + source_line_number: "2", + source: "helpers.erb", + name: "helpers.erb", + path: CHEF_SPEC_DATA + "/cookbooks/openldap/templates/default/helpers.erb", + local: false, + cookbook: nil, + variables: {}, + inline_helper_blocks: {}, + inline_helper_modules: [], + helper_modules: []) end it "creates the template with the rendered content" do diff --git a/spec/unit/resource_collection/resource_set_spec.rb b/spec/unit/resource_collection/resource_set_spec.rb index 403be4c566..60053d2b71 100644 --- a/spec/unit/resource_collection/resource_set_spec.rb +++ b/spec/unit/resource_collection/resource_set_spec.rb @@ -92,7 +92,7 @@ describe Chef::ResourceCollection::ResourceSet do collection.insert_as(zen_master) collection.insert_as(zen_follower) check_by_names(collection.find(zen_master: [zen_master_name], zen_follower: [zen_follower_name]), - zen_master_name, zen_follower_name) + zen_master_name, zen_follower_name) end it "should find resources of multiple kinds (:zen_master => a, :zen_follower => b with custom names)" do @@ -100,7 +100,7 @@ describe Chef::ResourceCollection::ResourceSet do collection.insert_as(zen_master2, :zzz, "name2") collection.insert_as(zen_follower, :yyy, "name3") check_by_names(collection.find(zzz: %w{name1 name2}, yyy: ["name3"]), - zen_master_name, zen_follower_name, zen_master2_name) + zen_master_name, zen_follower_name, zen_master2_name) end it "should find a resource by string zen_master[a]" do @@ -118,7 +118,7 @@ describe Chef::ResourceCollection::ResourceSet do collection.insert_as(zen_master) collection.insert_as(zen_master2) check_by_names(collection.find("zen_master[#{zen_master_name},#{zen_master2_name}]"), - zen_master_name, zen_master2_name) + zen_master_name, zen_master2_name) end it "should find array names" do @@ -138,14 +138,14 @@ describe Chef::ResourceCollection::ResourceSet do collection.insert_as(zen_master, :zzz, "name1") collection.insert_as(zen_master2, :zzz, "name2") check_by_names(collection.find("zzz[name1,name2]"), - zen_master_name, zen_master2_name) + zen_master_name, zen_master2_name) end it "should find resources of multiple types by strings of zen_master[a]" do collection.insert_as(zen_master) collection.insert_as(zen_follower) check_by_names(collection.find("zen_master[#{zen_master_name}]", "zen_follower[#{zen_follower_name}]"), - zen_master_name, zen_follower_name) + zen_master_name, zen_follower_name) end it "should find resources of multiple types by strings of zen_master[a] with custom names" do @@ -154,7 +154,7 @@ describe Chef::ResourceCollection::ResourceSet do collection.insert_as(zen_master2, :zzz, "name2") collection.insert_as(zen_follower, :yyy, "name3") check_by_names(collection.find("zzz[name1,name2]", "yyy[name3]"), - zen_master_name, zen_follower_name, zen_master2_name) + zen_master_name, zen_follower_name, zen_master2_name) end it "should only keep the last copy when multiple instances of a Resource are inserted" do diff --git a/spec/unit/resource_reporter_spec.rb b/spec/unit/resource_reporter_spec.rb index 2272c83967..a2ae786bb4 100644 --- a/spec/unit/resource_reporter_spec.rb +++ b/spec/unit/resource_reporter_spec.rb @@ -645,7 +645,7 @@ describe Chef::ResourceReporter do expect(rest_client).to receive(:post) .with("reports/nodes/spitfire/runs", { action: :start, run_id: @run_id, start_time: start_time.to_s }, - { "X-Ops-Reporting-Protocol-Version" => Chef::ResourceReporter::PROTOCOL_VERSION }) + { "X-Ops-Reporting-Protocol-Version" => Chef::ResourceReporter::PROTOCOL_VERSION }) .and_raise(@error) end @@ -674,7 +674,7 @@ describe Chef::ResourceReporter do @error = Net::HTTPClientException.new("500 message", @response) expect(rest_client).to receive(:post) .with("reports/nodes/spitfire/runs", { action: :start, run_id: @run_id, start_time: start_time.to_s }, - { "X-Ops-Reporting-Protocol-Version" => Chef::ResourceReporter::PROTOCOL_VERSION }) + { "X-Ops-Reporting-Protocol-Version" => Chef::ResourceReporter::PROTOCOL_VERSION }) .and_raise(@error) end @@ -704,7 +704,7 @@ describe Chef::ResourceReporter do @error = Net::HTTPClientException.new("500 message", @response) expect(rest_client).to receive(:post) .with("reports/nodes/spitfire/runs", { action: :start, run_id: @run_id, start_time: start_time.to_s }, - { "X-Ops-Reporting-Protocol-Version" => Chef::ResourceReporter::PROTOCOL_VERSION }) + { "X-Ops-Reporting-Protocol-Version" => Chef::ResourceReporter::PROTOCOL_VERSION }) .and_raise(@error) end @@ -725,7 +725,7 @@ describe Chef::ResourceReporter do response = { "uri" => "https://example.com/reports/nodes/spitfire/runs/@run_id" } expect(rest_client).to receive(:post) .with("reports/nodes/spitfire/runs", { action: :start, run_id: @run_id, start_time: start_time.to_s }, - { "X-Ops-Reporting-Protocol-Version" => Chef::ResourceReporter::PROTOCOL_VERSION }) + { "X-Ops-Reporting-Protocol-Version" => Chef::ResourceReporter::PROTOCOL_VERSION }) .and_return(response) resource_reporter.run_started(run_status) end diff --git a/spec/unit/shell/shell_session_spec.rb b/spec/unit/shell/shell_session_spec.rb index 2e32e6547d..6644ff6e0c 100644 --- a/spec/unit/shell/shell_session_spec.rb +++ b/spec/unit/shell/shell_session_spec.rb @@ -238,11 +238,11 @@ describe Shell::SoloLegacySession do it "passes the shell CLI args to the client" do @client = double("Chef::Client.new", - run_ohai: true, - load_node: true, - build_node: true, - register: true, - sync_cookbooks: {}) + run_ohai: true, + load_node: true, + build_node: true, + register: true, + sync_cookbooks: {}) expect(Chef::Client).to receive(:new).with(json_attribs, Chef::Config[:shell_config]).and_return(@client) @session.json_configuration = json_attribs @session.send(:rebuild_node) diff --git a/spec/unit/version_class_spec.rb b/spec/unit/version_class_spec.rb index 5543fbe3c7..9dc981bd4c 100644 --- a/spec/unit/version_class_spec.rb +++ b/spec/unit/version_class_spec.rb @@ -162,7 +162,7 @@ describe Chef::Version do ].each do |spec| it "(#{spec.first(3).join(' ')}) should be #{spec[3]}" do got = Chef::Version.new(spec[0]).send(spec[1], - Chef::Version.new(spec[2])) + Chef::Version.new(spec[2])) expect(got).to eq(spec[3]) end end |