Skip to main content

UseMultipackageInstalls

All Cookstyle Cops


The department is: Chef/Modernize

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


Enabled by defaultSupports autocorrectionTarget Chef Version
EnabledYesAll Versions

Pass an array of packages to package resources instead of iterating over an array of packages when using multi-package capable package subsystem such as apt, yum, chocolatey, dnf, or zypper. Multi-package installs are faster and simplify logs.

Examples

incorrect

%w(bmon htop vim curl).each do |pkg|
  package pkg do
    action :install
  end
end

correct

package %w(bmon htop vim curl)

Configurable attributes

NameDefault valueConfigurable values
Version Added6.0.0String
Exclude
  • **/metadata.rb
  • **/attributes/*.rb
  • **/Berksfile
Array

Was this page helpful?