summaryrefslogtreecommitdiff
path: root/chef-config
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2019-06-17 21:07:08 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2019-08-12 11:29:16 -0700
commit35a63ddc192e50c45f6e94a3b270ed0e75c93668 (patch)
treefed93952978c3b75febae5d90f80e1f0cd5fcc8b /chef-config
parent84da5f7a45d7ccba250d160626e6da8762a7f222 (diff)
downloadchef-35a63ddc192e50c45f6e94a3b270ed0e75c93668.tar.gz
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 <lamont@scriptkiddie.org>
Diffstat (limited to 'chef-config')
-rw-r--r--chef-config/lib/chef-config/config.rb16
1 files changed, 13 insertions, 3 deletions
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