Skip to main content

DeprecatedSudoActions

All Cookstyle Cops


The department is: Chef/Deprecations

The full name of the cop is: Chef/Deprecations/DeprecatedSudoActions


Enabled by default Supports autocorrection Target Chef Version
Enabled Yes 14.0+

The sudo resource in the sudo cookbook 5.0 (2018) or Chef Infra Client 14 and later have replaced the existing :install and :remove actions with :create and :delete actions to better match other resources in Chef Infra.

Examples

incorrect

sudo 'admins' do
  users 'bob'
  groups 'sysadmins, superusers'
  action :remove
end

correct

sudo 'admins' do
  users 'bob'
  groups 'sysadmins, superusers'
  action :delete
end

Configurable attributes

Name Default value Configurable values
Version Added 7.18.0 String
Exclude
  • **/spec/**/*.rb
  • **/metadata.rb
  • **/attributes/*.rb
  • **/Berksfile
  • **/Rakefile
Array

Was this page helpful?

×









Search Results