You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.
I have a use case where I have a cookbook that optionally includes splunk integration. It looks something like:
cerner_splunk_forwarder_monitors foo do
action :install
...
only_if { enable_splunk }
end
However, even if that enable_splunk attribute is set to false it still fails during the compilation phase if node['splunk']['home'] is not defined. The only_if clause is evaluated later on during the execution phase. I could modify that cookbook to do this:
if enable_splunk
cerner_splunk_forwarder_monitors foo do
action :install
...
end
end
but then foodcritic flags that as lint. Thoughts on moving that validation into the provider instead of doing it in the after_created on the resource?
I could also just define ['splunk']['home'] to be an empty string to get around the problem when the splunk recipe isn't on my runlist, but that feels a bit hacky too.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I have a use case where I have a cookbook that optionally includes splunk integration. It looks something like:
However, even if that enable_splunk attribute is set to false it still fails during the compilation phase if node['splunk']['home'] is not defined. The only_if clause is evaluated later on during the execution phase. I could modify that cookbook to do this:
but then foodcritic flags that as lint. Thoughts on moving that validation into the provider instead of doing it in the after_created on the resource?
I could also just define ['splunk']['home'] to be an empty string to get around the problem when the splunk recipe isn't on my runlist, but that feels a bit hacky too.
The text was updated successfully, but these errors were encountered: