From 35a63ddc192e50c45f6e94a3b270ed0e75c93668 Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Mon, 17 Jun 2019 21:07:08 -0700 Subject: Add unified_mode switch for resources This is inspired by "use_inline_resources". Setting `unified_mode false` in a resource would be the existing behavior with separate compile/converge phases. Setting `unified_mode true` in a resource will eliminate the converge phase. Reverse notifications and delayed notifications will still fire. The resource action will behave like all resources are executing at compile time. As a aside, notifications have never worked for resources firing at compile time. This implementation gets that behavior correct so that notifications will work. Of course forward immediate notifications to resources not yet declared will not be possible. Setting `resource_unified_mode_default true` in `Chef::Config` would turn off the split compile/converge mode for every custom resource. NOTE: This does not affect recipe mode at all. Signed-off-by: Lamont Granquist --- chef-config/lib/chef-config/config.rb | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'chef-config') diff --git a/chef-config/lib/chef-config/config.rb b/chef-config/lib/chef-config/config.rb index d136a8f79c..b0583b7a06 100644 --- a/chef-config/lib/chef-config/config.rb +++ b/chef-config/lib/chef-config/config.rb @@ -875,6 +875,7 @@ module ChefConfig # # NOTE: CHANGING THIS SETTING MAY CAUSE CORRUPTION, DATA LOSS AND # INSTABILITY. + # default :file_atomic_update, true # There are 3 possible values for this configuration setting. @@ -882,19 +883,28 @@ module ChefConfig # false => file staging is done via tempfiles under ENV['TMP'] # :auto => file staging will try using destination directory if possible and # will fall back to ENV['TMP'] if destination directory is not usable. + # default :file_staging_uses_destdir, :auto # Exit if another run is in progress and the chef-client is unable to # get the lock before time expires. If nil, no timeout is enforced. (Exits # immediately if 0.) + # default :run_lock_timeout, nil # Number of worker threads for syncing cookbooks in parallel. Increasing # this number can result in gateway errors from the server (namely 503 and 504). # If you are seeing this behavior while using the default setting, reducing # the number of threads will help. + # default :cookbook_sync_threads, 10 + # True if all resources by default default to unified mode, with all resources + # applying in "compile" mode, with no "converge" mode. False is backwards compatible + # setting for Chef 11-15 behavior. This will break forward notifications. + # + default :resource_unified_mode_default, false + # At the beginning of the Chef Client run, the cookbook manifests are downloaded which # contain URLs for every file in every relevant cookbook. Most of the files # (recipes, resources, providers, libraries, etc) are immediately synchronized @@ -920,9 +930,9 @@ module ChefConfig default :no_lazy_load, true # A whitelisted array of attributes you want sent over the wire when node - # data is saved. - # The default setting is nil, which collects all data. Setting to [] will not - # collect any data for save. + # data is saved. The default setting is nil, which collects all data. Setting + # to [] will not collect any data for save. + # default :automatic_attribute_whitelist, nil default :default_attribute_whitelist, nil default :normal_attribute_whitelist, nil -- cgit v1.2.1