-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixing resources reporting as updated #142
fixing resources reporting as updated #142
Conversation
…rces Signed-off-by: Jeremy J. Miller <[email protected]>
The result of testing collector = chef-server Notice 0/x resources updated.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great improvement @jeremymv2
end | ||
|
||
def load_audit_handler | ||
libpath = ::File.join(cookbook_handler_path, 'audit_report') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice approach!
|
||
# install inspec | ||
inspec 'inspec' do | ||
chef_gem 'inspec' do | ||
version node['audit']['inspec_version'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason why we are not using version new_resource.version if new_resource.version != 'latest'
?
@@ -13,4 +13,3 @@ | |||
chef_version '>= 12.5.1' if respond_to?(:chef_version) | |||
|
|||
depends 'compat_resource' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lamont-granquist Is there any real reason why we need compat_resource
Signed-off-by: Jeremy J. Miller <[email protected]>
This now supports |
Signed-off-by: Jeremy J. Miller <[email protected]>
def verify_inspec_version(inspec_version) | ||
require 'inspec' | ||
# check that we have the right inspec version | ||
if Inspec::VERSION != inspec_version && inspec_version !='latest' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jeremymv2 Do you think we should keep that warning. May be very helpful for debugging?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea @chris-rock
I've moved it under load_inspec_libs
function which seemed appropriate :)
Signed-off-by: Jeremy J. Miller <[email protected]>
Signed-off-by: Jeremy J. Miller <[email protected]>
Signed-off-by: Jeremy J. Miller <[email protected]>
@@ -3,6 +3,12 @@ | |||
# load all the inspec and compliance bundle requirements | |||
def load_inspec_libs | |||
require 'inspec' | |||
if Inspec::VERSION != node['audit']['inspec_version'] && node['audit']['inspec_version'] !='latest' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is a very nice idea
Awesome work @jeremymv2 |
Description
This PR removes the dependency on
chef_chandler
because that cookbook's LWRP reports updated resources for each handler enabled. It also removes theinspec
custom resource and simply makes it achef_gem
resource withcompile_time true
. This makes the assumption that inspec gem version is ALWAYS specified via attribute to a specific SEMVER version (node['audit']['inspec_version']
) - "latest" is no longer allowed.Issues Resolved
This addresses #138
Check List
Signed-off-by: Jeremy J. Miller [email protected]