libraries/helpers.rb
Prefer conditional attributes Open
Open
if node.platform_family == 'rhel'
- Read upRead up
- Exclude checks
This warning means you have surrounded a resource with an if
or unless
rather than defining the condition directly on the resource itself. Note
that this warning is only raised for single resources as you could
reasonably enclose multiple resources in a condition like this for
brevity.
Jay Feldblum has expressed criticism of this rule because the effect is that resources are defined unnecessarily and ignored only at run-time. His view is that it is cleaner to use standard Ruby conditionals to avoid defining them in the first place.