summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2021-07-28 17:34:28 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2021-07-28 17:34:28 -0700
commit0b9862a232e3b034f75f80a3dcc8a6d999dda0e1 (patch)
tree134b421d13fe998d0f921467f9ce8003e68d09fa
parent38f6e39265a4722c35ef66405bf33c2084e14bb2 (diff)
downloadchef-0b9862a232e3b034f75f80a3dcc8a6d999dda0e1.tar.gz
Turn on chef_node_attribute_enabled for compliance phase by default
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>
-rw-r--r--lib/chef/compliance/default_attributes.rb2
-rw-r--r--spec/unit/compliance/runner_spec.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/chef/compliance/default_attributes.rb b/lib/chef/compliance/default_attributes.rb
index 9196944b92..3a8c8f1ccc 100644
--- a/lib/chef/compliance/default_attributes.rb
+++ b/lib/chef/compliance/default_attributes.rb
@@ -88,7 +88,7 @@ class Chef
# If enabled, a hash representation of the Chef Infra node object will be sent to Chef InSpec in an input
# named `chef_node`.
- "chef_node_attribute_enabled" => false,
+ "chef_node_attribute_enabled" => true,
# Should the built-in compliance phase run. True and false force the behavior. Nil does magic based on if you have
# profiles defined but do not have the audit cookbook enabled.
diff --git a/spec/unit/compliance/runner_spec.rb b/spec/unit/compliance/runner_spec.rb
index e60195b8ec..e41b80f5b1 100644
--- a/spec/unit/compliance/runner_spec.rb
+++ b/spec/unit/compliance/runner_spec.rb
@@ -221,7 +221,7 @@ describe Chef::Compliance::Runner do
inputs = runner.inspec_opts[:inputs]
expect(inputs["tacos"]).to eq("lunch")
- expect(inputs.key?("chef_node")).to eq(false)
+ expect(inputs.key?("chef_node")).to eq(true)
end
it "includes chef_node in inputs with chef_node_attribute_enabled set" do