Definitions

All Cookstyle Cops


The department is: Chef/Modernize

The full name of the cop is: Chef/Modernize/Definitions


Enabled by default Supports autocorrection Target Chef Version
Enabled No All 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

Name Default value Configurable values
Version Added 5.11.0 String
Include
  • **/definitions/*.rb
Array

© Chef Software, Inc.
Licensed under the Creative Commons Attribution 3.0 Unported License.
The Chef™ Mark and Chef Logo are either registered trademarks/service marks or trademarks/servicemarks of Chef, in the United States and other countries and are used with Chef Inc's permission.
We are not affiliated with, endorsed or sponsored by Chef Inc.
https://docs.chef.io/workstation/cookstyle/chef_modernize_definitions/