Skip to main content

Chef/Deprecations/ResourceWithoutUnifiedTrue

Cookstyle cops page

The Cookstyle cops department: Chef/Deprecations

Enabled by defaultSupports autocorrectionTarget Chef Version
EnabledYes15.3+

Chef Infra Client 15.3 and later include a new Unified Mode that simplifies the execution of resources by replacing the traditional compile and converge phases with a single phase. Unified mode simplifies writing advanced resources and avoids confusing errors that often occur when mixing ruby and Chef Infra resources. Chef Infra Client 17.0 and later will begin warning that unified_mode true should be set in all resources to validate that they will continue to function in Chef Infra Client 18.0 (April 2022) when Unified Mode becomes the default.

Examples

# bad
resource_name :foo
provides :foo

action :create do
  # some action code
end

# good
resource_name :foo
provides :foo
unified_mode true

action :create do
  # some action code
end

Configurable attributes

NameDefault valueConfigurable values
Version Added7.12.0String
Include
  • **/resources/*.rb
Array

Thank you for your feedback!

×