summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordanielsdeleo <dan@opscode.com>2014-01-22 15:49:28 -0800
committerdanielsdeleo <dan@opscode.com>2014-01-22 15:49:28 -0800
commit25e2afe01d5e9d3e156c90f0a923906582a70f3e (patch)
tree6c18c30a445c14c07352385a236cb9f2a5a7c0d2
parent8cf6427638d3d4f50a984d5a9c204d85f275c7bd (diff)
downloadchef-25e2afe01d5e9d3e156c90f0a923906582a70f3e.tar.gz
Allow policyfile feature to be enabled in config
-rw-r--r--lib/chef/config.rb10
-rw-r--r--lib/chef/policy_builder.rb6
2 files changed, 15 insertions, 1 deletions
diff --git a/lib/chef/config.rb b/lib/chef/config.rb
index f5cba9e0ed..da3f3790f6 100644
--- a/lib/chef/config.rb
+++ b/lib/chef/config.rb
@@ -320,6 +320,16 @@ class Chef
default :enable_reporting, true
default :enable_reporting_url_fatals, false
+ # Policyfile is an experimental feature where a node gets its run list and
+ # cookbook version set from a single document on the server instead of
+ # expanding the run list and having the server compute the cookbook version
+ # set based on environment constraints.
+ #
+ # Because this feature is experimental, it is not recommended for
+ # production use. Developent/release of this feature may not adhere to
+ # semver guidelines.
+ default :use_policyfile, false
+
# Set these to enable SSL authentication / mutual-authentication
# with the server
diff --git a/lib/chef/policy_builder.rb b/lib/chef/policy_builder.rb
index 2ba3cf839e..136b2853b0 100644
--- a/lib/chef/policy_builder.rb
+++ b/lib/chef/policy_builder.rb
@@ -38,7 +38,11 @@ class Chef
module PolicyBuilder
def self.strategy
- ExpandNodeObject
+ if Chef::Config[:use_policyfile]
+ Policyfile
+ else
+ ExpandNodeObject
+ end
end
end