Skip to main content

Chef/Modernize/Definitions

Cookstyle cops page

The Cookstyle cops department: Chef/Modernize

Enabled by defaultSupports autocorrectionTarget Chef Version
EnabledNoAll Versions

In 2016 with Chef Infra Client 12.5 Custom Resources were introduced as a way of writing reusable resource code that could be shipped in cookbooks. Custom Resources offer many advantages of legacy Definitions including unit testing with ChefSpec, input validation, actions, common properties like not_if/only_if, and resource reporting.

Examples

Configurable attributes

NameDefault valueConfigurable values
Version Added5.11.0String
Include
  • **/definitions/*.rb
Array

Thank you for your feedback!

×









Search Results