summaryrefslogtreecommitdiff
path: root/spec/unit
Commit message (Collapse)AuthorAgeFilesLines
* Remove the default json logger from the compliance APIlcg/compliance-remove-json-loggerLamont Granquist2021-08-171-1/+1
| | | | | | | | | | | | This indirectly fixes #11585 and avoids the json logger silently consuming disk space. By reverting back to a single value we also avoid the attributes array merging issues. This might conceivably change behavior to people who were reliant on the additive array-merge behavior, but the compliance profile have been considered experimental. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Add support for provider action descriptionMarc A. Paradise2021-08-112-8/+42
| | | | | | | | | | | | | | | | | Often actions are defined on the provider and not on the resource. This change updates Provider to support a description opt when declaring the action, which lets us improve our generated documentation. This also updates ResourceInspector to look at the provider if the resource itself does not offer an action description for a given action. Example: action :foo, description: "bar" do ... end Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
* forgot to fix the text in the specLamont Granquist2021-07-301-1/+1
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Rename inspec attributes to inputs in compliance phaseLamont Granquist2021-07-291-0/+44
| | | | | | | | | | Supports attributes as a fallback. Blows up if you set both. Closes #11572 Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Turn on chef_node_attribute_enabled for compliance phase by defaultLamont Granquist2021-07-281-1/+1
| | | | | | | | | Getting Chef Infra attributes into Chef Inspec inputs is a FAQ and this seems like an obviously better default. We are unaware of any breaking change this would cause. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Allow az vault name to be included in secret nameMarc A. Paradise2021-07-271-15/+22
| | | | | | | | | | | | | | | | | | | | | This modifies the `:azure_key_vault` fetcher so that it's possible to fetch a secret by embedding the vault name in the secret name instead of providing it in configuration. This continues down the path of making secrets accessible with less typing and sane default expectations. Example: ``` file "/home/ubuntu/test2" do content secret(name: "test-chef-infra-secrets/test-secret-1", service: :azure_key_vault) end ``` Specifying vault name via configuration is still supported, but if it is specified in the secret name as well that will take precedence. Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
* Chefstyle fixesTim Smith2021-07-261-3/+3
| | | | Signed-off-by: Tim Smith <tsmith@chef.io>
* Merge pull request #11842 from byplayer/homebrew_cask_name_issueTim Smith2021-07-261-11/+29
|\ | | | | Support '-' and '@' for homebrew cask name
| * Remove duplicated testsbyplayer2021-07-261-26/+0
| | | | | | | | | | | | | | To clarify what I want to do test in this change I remove duplicated test based on @tas50 review comment. Signed-off-by: byplayer <byplayer100@gmail.com>
| * Support '-' and '@' for homebrew cask namebyplayer2021-07-211-11/+55
| | | | | | | | | | Some cask name include '-' and '@' so I fix regular expression for cask name validation.
* | Merge pull request #11853 from chef/mp/11851Tim Smith2021-07-264-12/+88
|\ \ | | | | | | Signed-off-by: Tim Smith <tsmith@chef.io>
| * | secrets: aws fetcher uses node attributes for regionMarc A. Paradise2021-07-261-0/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When region is not specified and is not in AWS global configuration, we'll now default to the region in `node["ec2"]["region"]`; and we will fail if that is also not provided. This provides a sane and predictable way to play nicely with AWS SDK's default config loading behavior. Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
| * | Provide run context to secret fetchersMarc A. Paradise2021-07-263-12/+18
| | | | | | | | | | | | | | | | | | | | | This will allow them to use node attributes for configuration, such as ohai data for determining region. Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
* | | Fixed generates systemd service should not have spaces around the equal signs.antima-gupta2021-07-231-1/+1
|/ / | | | | | | | | | | Fixed testcase failure. Signed-off-by: antima-gupta <agupta@msystechnologies.com>
* | Add windows_update_settings resourceTim Smith2021-07-201-0/+64
| | | | | | | | | | | | | | Copied from the desktop-config cookbook and simplified a little bit to skip properties we can calculate automatically. Signed-off-by: Tim Smith <tsmith@chef.io>
* | Merge pull request #11802 from chef/mp/azure-key-vaultMarc A. Paradise2021-07-193-5/+72
|\ \ | | | | | | Secrets: Azure Key Vault fetcher; versioned secret support
| * | rubocop fixesMarc A. Paradise2021-07-151-3/+3
| | | | | | | | | | | | Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
| * | Add experimental fetcher for Azure Key VaultMarc A. Paradise2021-07-152-0/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Usage in a recipe looks like this: value = secret(name: "test1", version: "v1", service: :azure_key_vault, config: { vault: "myvault" } ) Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
| * | Allow versioned secrets via DSLMarc A. Paradise2021-07-152-5/+5
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | Versioning is commonly supported across most major secrets services. This change allows the DSL to support fetching a specific secret version. Implementations are expected to default to fetching the most recent version when no version is provided. Usage: secret(name: 'secret1', version: 'version1', service: :example) Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
* | Merge pull request #11803 from chef/lcg/policyfile-run-listLamont Granquist2021-07-161-44/+115
|\ \ | |/ |/|
| * Support command line setting of run_list with policyfilesLamont Granquist2021-07-131-44/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will allow temporarily setting the run list to a different setting and still having the node saved (complimentary to setting an override run list which does not save the node). This can be used inside of test-kitchen for setting the run_list to a fixture cookbook that is not in the policyfile without needing to go through named_run_lists. This can also be used with -j or -r on provisioning to run a bootstrapping recipe, which will then be overridden by the policyfile. A switch is included to cause the node.run_list setting from the -j or -r setting (or setting via code with `node.run_list <<`) to persist and to override the policyfile. This is for sites which have adopted complicated run_list mutating workflows to make it so they can set Chef::Config[:policy_persist_run_list] to true and will be able to migrate those workflows more easily to a policyfile world. When it is run in this configuration it will always print a WARN level message that the policyfile is being overridden since it is not intended that the common state of the server would be to ignore the policyfile run_list. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | Experimental support for an AWS Secrets FetcherMarc A. Paradise2021-07-141-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In a recipe, usage will look like the following: value = secret(name: "test1", service: :aws_secrets_manager, config: { region: "us-west-1" }) log "My secret is #{value.secret_string}" Note the use of `secret_string` to determine the secret value. The returned object here is Aws::Types::GetSecretValueResponse from the AWS SDK. This beta implementation supports ec2/imds instance profile authentication but also checks standard locations for credentials configuration -- see documentation [1] for a description of default credentials search behavior. [1] https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/SecretsManager/Client.html#initialize-instance_method Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
* | Deprecate the old policyfile compat modeLamont Granquist2021-07-131-1/+11
| | | | | | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | Mark resource blocks containing secrets sensitiveMarc A. Paradise2021-07-091-2/+17
| | | | | | | | | | | | | | | | When a resource block contains usage of the secrets DSL, auto-mark that resource sensitive to help reduce the potential for sensitive data to be output to logs/stdout. Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
* | Add habitat resources + content rendering helpers for json/toml/yaml (#11577)Jeff Brimager2021-07-082-1/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commiting new resources to clean branch Signed-off-by: Jeff Brimager <jbrimager@chef.io> * reworked toml_dumper resource helper to make sure all end statements were correct and it was being made available to other resource Signed-off-by: Jeff Brimager <jbrimager@chef.io> * changing implementation of toml_deumper to match how the cron_validations helper was implemented Signed-off-by: Jeff Brimager <jbrimager@chef.io> * changing implementation of toml_dumper to match how the cron_validations helper was implemented Signed-off-by: Jeff Brimager <jbrimager@chef.io> * calling toml dumper as a method Signed-off-by: Jeff Brimager <jbrimager@chef.io> * testing new method for toml_dumper helper Signed-off-by: Jeff Brimager <jbrimager@chef.io> * adding "use" statement for toml helper in habitat_config and habitat_toml Signed-off-by: Jeff Brimager <jbrimager@chef.io> * fixing relational mapping with toml_dumper Signed-off-by: Jeff Brimager <jbrimager@chef.io> * using Chef::ResourceHelper::TomlDumper as method to create toml Signed-off-by: Jeff Brimager <jbrimager@chef.io> * correcting syntax error for Chef::ResourceHelpers:: in the habitat_config and habitat_user_toml resource Signed-off-by: Jeff Brimager <jbrimager@chef.io> * adding a render helper Signed-off-by: Jeff Brimager <jbrimager@chef.io> * moved files to correct directories for render_helpers and corrected resource syntax Signed-off-by: Jeff Brimager <jbrimager@chef.io> * chefstyle corrections Signed-off-by: Jeff Brimager <jbrimager@chef.io> * removed renderhelers form chef-utils. there by mistake Signed-off-by: Jeff Brimager <jbrimager@chef.io> * corrected class for render helpers Signed-off-by: Jeff Brimager <jbrimager@chef.io> * fixed broken end statement in chef/dsl/toml.rb Signed-off-by: Jeff Brimager <jbrimager@chef.io> * corrected render helper class syntax line 23. was set as a module ; Signed-off-by: Jeff Brimager <jbrimager@chef.io> * corrected dsl helper mapping for render_helpers in spec tests Signed-off-by: Jeff Brimager <jbrimager@chef.io> * wiring chef-utls/internal to render_helpers Signed-off-by: Jeff Brimager <jbrimager@chef.io> * remove "include internal" from render_helpers Signed-off-by: Jeff Brimager <jbrimager@chef.io> * removed old helper from habitat_config and habitat_user_toml resources Signed-off-by: Jeff Brimager <jbrimager@chef.io> * removed old helper from habitat_config and habitat_user_toml resources Signed-off-by: Jeff <jbrimager@gmail.com> * removed old helper from habitat_config and habitat_user_toml resources Signed-off-by: Jeff Brimager <jbrimager@chef.io> * chefstyle corrections on render_helpers_spec Signed-off-by: Jeff Brimager <jbrimager@chef.io> * chefstyle corrections on chef-utils/lib/chef-utils.rb Signed-off-by: Jeff Brimager <jbrimager@chef.io> * added all documentation to resources Signed-off-by: Jeff Brimager <jbrimager@chef.io> * cleaned up render_helper_spec.rb Signed-off-by: Jeff Brimager <jbrimager@chef.io> * cleaning up spellcheck errors Signed-off-by: Jeff Brimager <jbrimager@chef.io> * removing unused variable from habitat package provider Signed-off-by: Jeff Brimager <jbrimager@chef.io> * correecting bad syntaxt in habitat_package Signed-off-by: Jeff Brimager <jbrimager@chef.io> * temporarioly remove prperty descriptions from habitat_install Signed-off-by: Jeff Brimager <jbrimager@chef.io> * removing documentation changes the habitat_package and habitat_sup as well Signed-off-by: Jeff Brimager <jbrimager@chef.io> * cleaninig up commented issues Signed-off-by: Jeff Brimager <jbrimager@chef.io> * added all property descriptions back to habitat resources Signed-off-by: Jeff Brimager <jbrimager@chef.io> * corrected chefstule errros Signed-off-by: Jeff Brimager <jbrimager@chef.io> * cleaned up descriptions in habitat_install Signed-off-by: Jeff Brimager <jbrimager@chef.io> * cleaning up bad trailing spaces Signed-off-by: Jeff Brimager <jbrimager@chef.io> * fixed kitchen runlist for linux Signed-off-by: Jeff Brimager <jbrimager@chef.io> * removing habitat from package providers Signed-off-by: Jeff Brimager <jbrimager@chef.io> * cleaned up bad character in habitat install Signed-off-by: Jeff Brimager <jbrimager@chef.io> * fixed habitat_package resource Signed-off-by: Jeff Brimager <jbrimager@chef.io> * changing how habitat_package connects to its provider Signed-off-by: Jeff Brimager <jbrimager@chef.io> * converted habitat_package_provider to a resource class Signed-off-by: Jeff Brimager <jbrimager@chef.io> * chefstyle corrections made Signed-off-by: Jeff Brimager <jbrimager@chef.io> * connecting habitat_package with _provider Signed-off-by: Jeff Brimager <jbrimager@chef.io> * testing habitat_package_provider Signed-off-by: Jeff Brimager <jbrimager@chef.io> * changing resource method for habit_package_provider Signed-off-by: Jeff Brimager <jbrimager@chef.io> * more chefstyle corrections Signed-off-by: Jeff Brimager <jbrimager@chef.io> * reverted changes Signed-off-by: Jeff Brimager <jbrimager@chef.io> * correcting end statements and bad syntax Signed-off-by: Jeff Brimager <jbrimager@chef.io> * trying to alter habitat_package_provider to work as a resource Signed-off-by: Jeff Brimager <jbrimager@chef.io> * altering the methods for remove_package in habitat_provider_package Signed-off-by: Jeff Brimager <jbrimager@chef.io> * mapping exceptions to habitat package provider Signed-off-by: Jeff Brimager <jbrimager@chef.io> * habitat_package resource connected to habitat_package_provider Signed-off-by: Jeff Brimager <jbrimager@chef.io> * removed V2 hab version compare from habitat_package provider we will only support systemd moving forward Signed-off-by: Jeff Brimager <jbrimager@chef.io> * removing yesterdays changes to see if they are causing the issue with habitat_sup Signed-off-by: Jeff Brimager <jbrimager@chef.io> * reverting the habitat_package provider to previous state Signed-off-by: Jeff Brimager <jbrimager@chef.io> * removing bad test Signed-off-by: Jeff Brimager <jbrimager@chef.io> * restored the version_compare in habitat provider Signed-off-by: Jeff Brimager <jbrimager@chef.io> * correcting spellcheck issues Signed-off-by: Jeff Brimager <jbrimager@chef.io> * commiting new resources to clean branch Signed-off-by: Jeff Brimager <jbrimager@chef.io> * reworked toml_dumper resource helper to make sure all end statements were correct and it was being made available to other resource Signed-off-by: Jeff Brimager <jbrimager@chef.io> * changing implementation of toml_deumper to match how the cron_validations helper was implemented Signed-off-by: Jeff Brimager <jbrimager@chef.io> * changing implementation of toml_dumper to match how the cron_validations helper was implemented Signed-off-by: Jeff Brimager <jbrimager@chef.io> * calling toml dumper as a method Signed-off-by: Jeff Brimager <jbrimager@chef.io> * testing new method for toml_dumper helper Signed-off-by: Jeff Brimager <jbrimager@chef.io> * adding "use" statement for toml helper in habitat_config and habitat_toml Signed-off-by: Jeff Brimager <jbrimager@chef.io> * fixing relational mapping with toml_dumper Signed-off-by: Jeff Brimager <jbrimager@chef.io> * using Chef::ResourceHelper::TomlDumper as method to create toml Signed-off-by: Jeff Brimager <jbrimager@chef.io> * correcting syntax error for Chef::ResourceHelpers:: in the habitat_config and habitat_user_toml resource Signed-off-by: Jeff Brimager <jbrimager@chef.io> * adding a render helper Signed-off-by: Jeff Brimager <jbrimager@chef.io> * moved files to correct directories for render_helpers and corrected resource syntax Signed-off-by: Jeff Brimager <jbrimager@chef.io> * chefstyle corrections Signed-off-by: Jeff Brimager <jbrimager@chef.io> * removed renderhelers form chef-utils. there by mistake Signed-off-by: Jeff Brimager <jbrimager@chef.io> * corrected class for render helpers Signed-off-by: Jeff Brimager <jbrimager@chef.io> * fixed broken end statement in chef/dsl/toml.rb Signed-off-by: Jeff Brimager <jbrimager@chef.io> * corrected render helper class syntax line 23. was set as a module ; Signed-off-by: Jeff Brimager <jbrimager@chef.io> * corrected dsl helper mapping for render_helpers in spec tests Signed-off-by: Jeff Brimager <jbrimager@chef.io> * wiring chef-utls/internal to render_helpers Signed-off-by: Jeff Brimager <jbrimager@chef.io> * remove "include internal" from render_helpers Signed-off-by: Jeff Brimager <jbrimager@chef.io> * removed old helper from habitat_config and habitat_user_toml resources Signed-off-by: Jeff Brimager <jbrimager@chef.io> * removed old helper from habitat_config and habitat_user_toml resources Signed-off-by: Jeff Brimager <jbrimager@chef.io> * chefstyle corrections on render_helpers_spec Signed-off-by: Jeff Brimager <jbrimager@chef.io> * chefstyle corrections on chef-utils/lib/chef-utils.rb Signed-off-by: Jeff Brimager <jbrimager@chef.io> * added all documentation to resources Signed-off-by: Jeff Brimager <jbrimager@chef.io> * cleaned up render_helper_spec.rb Signed-off-by: Jeff Brimager <jbrimager@chef.io> * cleaning up spellcheck errors Signed-off-by: Jeff Brimager <jbrimager@chef.io> * removing unused variable from habitat package provider Signed-off-by: Jeff Brimager <jbrimager@chef.io> * correecting bad syntaxt in habitat_package Signed-off-by: Jeff Brimager <jbrimager@chef.io> * temporarioly remove prperty descriptions from habitat_install Signed-off-by: Jeff Brimager <jbrimager@chef.io> * removing documentation changes the habitat_package and habitat_sup as well Signed-off-by: Jeff Brimager <jbrimager@chef.io> * cleaninig up commented issues Signed-off-by: Jeff Brimager <jbrimager@chef.io> * added all property descriptions back to habitat resources Signed-off-by: Jeff Brimager <jbrimager@chef.io> * corrected chefstule errros Signed-off-by: Jeff Brimager <jbrimager@chef.io> * cleaned up descriptions in habitat_install Signed-off-by: Jeff Brimager <jbrimager@chef.io> * cleaning up bad trailing spaces Signed-off-by: Jeff Brimager <jbrimager@chef.io> * fixed kitchen runlist for linux Signed-off-by: Jeff Brimager <jbrimager@chef.io> * removing habitat from package providers Signed-off-by: Jeff Brimager <jbrimager@chef.io> * cleaned up bad character in habitat install Signed-off-by: Jeff Brimager <jbrimager@chef.io> * fixed habitat_package resource Signed-off-by: Jeff Brimager <jbrimager@chef.io> * changing how habitat_package connects to its provider Signed-off-by: Jeff Brimager <jbrimager@chef.io> * converted habitat_package_provider to a resource class Signed-off-by: Jeff Brimager <jbrimager@chef.io> * chefstyle corrections made Signed-off-by: Jeff Brimager <jbrimager@chef.io> * connecting habitat_package with _provider Signed-off-by: Jeff Brimager <jbrimager@chef.io> * testing habitat_package_provider Signed-off-by: Jeff Brimager <jbrimager@chef.io> * changing resource method for habit_package_provider Signed-off-by: Jeff Brimager <jbrimager@chef.io> * more chefstyle corrections Signed-off-by: Jeff Brimager <jbrimager@chef.io> * reverted changes Signed-off-by: Jeff Brimager <jbrimager@chef.io> * correcting end statements and bad syntax Signed-off-by: Jeff Brimager <jbrimager@chef.io> * trying to alter habitat_package_provider to work as a resource Signed-off-by: Jeff Brimager <jbrimager@chef.io> * altering the methods for remove_package in habitat_provider_package Signed-off-by: Jeff Brimager <jbrimager@chef.io> * mapping exceptions to habitat package provider Signed-off-by: Jeff Brimager <jbrimager@chef.io> * habitat_package resource connected to habitat_package_provider Signed-off-by: Jeff Brimager <jbrimager@chef.io> * removed V2 hab version compare from habitat_package provider we will only support systemd moving forward Signed-off-by: Jeff Brimager <jbrimager@chef.io> * removing yesterdays changes to see if they are causing the issue with habitat_sup Signed-off-by: Jeff Brimager <jbrimager@chef.io> * reverting the habitat_package provider to previous state Signed-off-by: Jeff Brimager <jbrimager@chef.io> * removing bad test Signed-off-by: Jeff Brimager <jbrimager@chef.io> * restored the version_compare in habitat provider Signed-off-by: Jeff Brimager <jbrimager@chef.io> * correcting spellcheck issues Signed-off-by: Jeff Brimager <jbrimager@chef.io> * adding documentation to habitat resources Signed-off-by: Jeff Brimager <jbrimager@chef.io> * correcting doc format in habitat_sup Signed-off-by: Jeff Brimager <jbrimager@chef.io> * cleaned up descrtipstions and added proper tagging for doc generation Signed-off-by: Jeff Brimager <jbrimager@chef.io> * removed require_relative "toml" from render helpers Signed-off-by: Jeff Brimager <jbrimager@chef.io> * misunderstanding in refactor. code added back for require_relative Signed-off-by: Jeff Brimager <jbrimager@chef.io> * misunderstanding in refactor. code added back for require_relative Signed-off-by: Jeff Brimager <jbrimager@chef.io> * added use_multipackage_api to habitat_package_provider Signed-off-by: Jeff Brimager <jbrimager@chef.io> * added guard to make sure habitat linux was only tested on systemd capable machines Signed-off-by: Jeff Brimager <jbrimager@chef.io> * extended timeout loops on _habitat_services kitchen tests Signed-off-by: Jeff Brimager <jbrimager@chef.io> * removed unnecessary tesys Signed-off-by: Jeff Brimager <jbrimager@chef.io> * removed deprecated test method for habitat package version_compare Signed-off-by: Jeff Brimager <jbrimager@chef.io> * removing private tag in the habitat package provider Signed-off-by: Jeff Brimager <jbrimager@chef.io> * more corrections to the habitat_package provider for testing Signed-off-by: Jeff Brimager <jbrimager@chef.io> * removed bad line in habitat package provider Signed-off-by: Jeff Brimager <jbrimager@chef.io> * corrected punctuation on all habitat descriptions Signed-off-by: Jeff Brimager <jbrimager@chef.io> * adding notes to tk runs to explain why service loads are looped Signed-off-by: Jeff Brimager <jbrimager@chef.io> * correcting spellcheck errors Signed-off-by: Jeff Brimager <jbrimager@chef.io> * merging master Signed-off-by: Jeff Brimager <jbrimager@chef.io>
* | Pass new_resource.version as nil and expect stubbed versiongscho2021-07-081-1/+2
| | | | | | | | Signed-off-by: gscho <greg.c.schofield@gmail.com>
* | Add user provided options to powershell_package commandsgscho2021-07-081-12/+73
| | | | | | | | Signed-off-by: gscho <greg.c.schofield@gmail.com>
* | Add 'secret' to the Chef DSLMarc A. Paradise2021-07-072-0/+124
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a proposed addition of a 'secret' helper to the Chef DSL, where a 'secret' is private data stored within a secrets management service. Usage would look like the following working example: ``` # The included ':example' secrets provider # requires that it be configured with a hash of secrets my_config = { "secret1" => "a hidden door" } file "/tmp/the-secret" do content secret(name: "secret1", service: :example, config: my_config) end ``` Initial constraints: * minimal-to-no abstraction over how services handle inputs, outputs, and errors. Each of these services has well-defined interfaces already, and there is much more different than the same across services. We may revisit this as we begin implementing a range of specific secrets fetchers. * no caching of results. * avoid 'provider' nomenclature. That's already well-used within Chef Infra. That's why a secrets 'service' has a SecretFetcher implementation and not a SecretProvider. Security Concerns: Because we don't provide an abstraction around the returned secret (there is not a specific single type of returned data we can rely on), if a secrets fetcher does not take steps to hide its own data from incidental output (logs, debug output, exceptions) then there is a risk of exposing this data to people and systems that have the ability to view the output. Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
* Merge pull request #11741 from chef/lcg/policyfile-overrideLamont Granquist2021-07-062-18/+20
|\ | | | | Support override run_lists in policyfiles
| * Support override run_lists in policyfilesLamont Granquist2021-06-222-18/+20
| | | | | | | | | | | | This extends override run_lists to work with policyfiles Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | fix File.exist stubbingLamont Granquist2021-06-211-1/+3
|/ | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Revert "Fixed Validation failed while creating databag and databag item"Lamont Granquist2021-06-212-3/+3
| | | | This reverts commit 19f127b7ff177bed0a0ebdfd2e0720f6acfc6bd2.
* Add specsTim Smith2021-06-132-0/+133
| | | | Signed-off-by: Tim Smith <tsmith@chef.io>
* Do not send blocked attributes to data collectorMarc A. Paradise2021-06-091-1/+47
| | | | | | | | | | | This uses the newly exposed Chef::Node#data_for_save to ensure that the data we're submitting to data collector has allow/block rules applied, the same way that we do for node.save. Fixes #10895 Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
* Merge pull request #11657 from chef/jfm/win_firewallLamont Granquist2021-06-071-7/+12
|\
| * Updated the firewall rule resource to allow for multiple remote addresses, ↵John McCrae2021-06-041-1/+1
| | | | | | | | | | | | updated the spec file to account for the change in data types Signed-off-by: John McCrae <john.mccrae@progress.com>
| * Updated the firewall rule resource to allow for multiple remote addresses, ↵John McCrae2021-06-031-1/+1
| | | | | | | | | | | | updated the spec file to account for the change in data types Signed-off-by: John McCrae <john.mccrae@progress.com>
| * Updated the firewall rule resource to allow for multiple remote addresses, ↵John McCrae2021-06-031-6/+11
| | | | | | | | | | | | updated the spec file to account for the change in data types Signed-off-by: John McCrae <john.mccrae@progress.com>
* | Merge pull request #11660 from chef/zypperLamont Granquist2021-06-072-11/+4
|\ \
| * | More spec updatesTim Smith2021-06-051-10/+3
| | | | | | | | | | | | Signed-off-by: Tim Smith <tsmith@chef.io>
| * | Fix failing specTim Smith2021-06-051-1/+1
| | | | | | | | | | | | Signed-off-by: Tim Smith <tsmith@chef.io>
* | | Merge pull request #11636 from chef/jfm/windows_pagefileTim Smith2021-06-041-9/+4
|\ \ \ | |/ / |/| | Updated the Windows Pagefile resource to use PowerShell over WMI, added a corresponding test file
| * | Updated the Windows Pagefile resource to use PowerShell over WMI, added a ↵John McCrae2021-06-021-4/+4
| | | | | | | | | | | | | | | | | | corresponding test file Signed-off-by: John McCrae <john.mccrae@progress.com>
| * | Updated the Windows Pagefile resource to use PowerShell over WMI, added a ↵John McCrae2021-06-011-2/+2
| | | | | | | | | | | | | | | | | | corresponding test file Signed-off-by: John McCrae <john.mccrae@progress.com>
| * | Updated the Windows Pagefile resource to use PowerShell over WMI, added a ↵John McCrae2021-05-271-5/+0
| | | | | | | | | | | | | | | | | | corresponding test file Signed-off-by: John McCrae <john.mccrae@progress.com>
* | | Merge pull request #11648 from chef/lcg/add-slow-reportLamont Granquist2021-06-011-2/+8
|\ \ \ | | | | | | | | Fix Chef::Handler specs and slow report behavior
| * | | Fix Chef::Handler specs and slow report behaviorLamont Granquist2021-06-011-2/+8
| | |/ | |/| | | | | | | | | | | | | | | | | | | The slow report now walks through action records instead of the resources and should have unique records for elapsed_time and will report the slowest actions. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | | Merge pull request #11629 from chef/mp/11354Tim Smith2021-06-011-0/+52
|\ \ \ | |/ / |/| | Support recipes that and in .yaml as well as .yml
| * | reject cookbooks with ambiguous yaml filesMarc A. Paradise2021-05-271-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With this change we will now fail the run when a cookbook contains two same-named YAML files with different extensions. THis is because we don't know which one to use - either one is a valid YAML file extension. Instead of picking one arbitrarily we'll fail with an error explaining how to resolve it. For example if the cookbook contains both recipes/default.yaml and recipes/default.yml it will fail with the following output: Cookbook test1@0.1.0 contains ambiguous files: recipes/default.yaml and recipes/default.yml. Please update the cookbook to remove the incorrect file. Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
| * | Support recipes that and in .yaml as well as .ymlMarc A. Paradise2021-05-261-0/+37
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds support for recipe files that end in the '.yaml' extension in addition to existing support for '.yml', because both are valid and common extensions for yaml files. Of note is that the message we log when a recipes/default.y[a]ml and a root_files/recipe.y[a]ml both exist will be slightly off, in that we don't capture the actual extension of each file. This seems to be more complexity than it was worth, for a message that is shown at the beginning of the run and largely ignored. I also tried to add a bit of localized unit testing for `recipe_yml_filenames_by_name` because we didn't before. Mostly focuses on this use case (yaml, yml both work) but we could probalby improve that by including tests for a mix of yaml/yml files. Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>