Ignore inspec_version for chef client >= 15 #378
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
default['audit']['inspec_version']
attribute has been added to the cookbook before chef-client came with an embedded InSpec gem.Currently the
inspec_gem
resource of theaudit
cookbook is uninstalling the existing versions of InSpec and installing the one specified by theinspec_version
attribute. With the release of Chef Infra Client 15, this breaks/opt/chef/bin/chef-client
as can be seen here:I reproduced this issue by converging a node with
Chef Infra Client 15.0.300
and theaudit
cookbook with attributeinspec_version
set to4.6.4
. Theinspec_gem
resource uninstalled the embeddedinspec-core
version4.3.2
and installed4.6.4
.With this PR the audit cookbook ignores the
inspec_version
attribute when Chef Infra Client version 15+ is detected and uses the embedded InSpec gem for the scan. Not breaking chef-client at this moment is more important than using a specific version of InSpec for the scan.