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 defaultSupports autocorrectionTarget Chef Version
EnabledYes14.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

NameDefault valueConfigurable values
Version Added7.18.0String
Exclude
  • **/spec/**/*.rb
  • **/metadata.rb
  • **/attributes/*.rb
  • **/Berksfile
  • **/Rakefile
Array

Was this page helpful?

×








Search Results