In Chef 12.1 we introduced multipackage installs. Instead of shelling
out to dpkg for each package to determine what we should do we gather
the information we need and check each package in the array. It's faster
and it takes less memory. It's especially useful after the first run when
nothing actually changes. Far fewer resources consumed.
I noticed you arranged the packages so I tried to keep them to that
same arrangement and I used multiline arrays since they make the diffs
nicer in the future as you add / remove packages. This isn't necessary
for Chef 13, but it's best practice.
Signed-off-by: Tim Smith <tsmith@chef.io>
Closes #137
30 files changed:
# limitations under the License.
#
# limitations under the License.
#
-package "zsh" do
- action :install
-end
-package "apache2"
-package "libwww-perl"
+package %w[
+ apache2
+ libwww-perl
+]
%w[event itk prefork worker].each do |mpm|
if mpm == node[:apache][:mpm]
%w[event itk prefork worker].each do |mpm|
if mpm == node[:apache][:mpm]
# limitations under the License.
#
# limitations under the License.
#
-package "apt"
-package "gnupg-curl"
-package "update-notifier-common"
+package %w[
+ apt
+ gnupg-curl
+ update-notifier-common
+]
file "/etc/motd.tail" do
action :delete
file "/etc/motd.tail" do
action :delete
# limitations under the License.
#
# limitations under the License.
#
-package "perl"
-package "libdate-calc-perl"
+package %w[
+ perl
+ libdate-calc-perl
+]
directory "/store/backup" do
owner "osmbackup"
directory "/store/backup" do
owner "osmbackup"
include_recipe "apache"
include_recipe "git"
include_recipe "apache"
include_recipe "git"
-package "ruby"
-package "ruby-dev"
-package "make"
-package "gcc"
-package "libsqlite3-dev"
+package %w[
+ ruby
+ ruby-dev
+ make
+ gcc
+ libsqlite3-dev
+]
# limitations under the License.
#
# limitations under the License.
#
-package "clamav-daemon"
-package "clamav-freshclam"
-package "clamav-unofficial-sigs"
+package %w[
+ clamav-daemon
+ clamav-freshclam
+ clamav-unofficial-sigs
+]
template "/etc/clamav-unofficial-sigs.conf.d/50-chef.conf" do
source "clamav-unofficial-sigs.conf.erb"
template "/etc/clamav-unofficial-sigs.conf.d/50-chef.conf" do
source "clamav-unofficial-sigs.conf.erb"
include_recipe "postgresql"
include_recipe "python"
include_recipe "postgresql"
include_recipe "python"
-package "php"
-package "php-cgi"
-package "php-cli"
-package "php-curl"
-package "php-db"
-package "php-fpm"
-package "php-imagick"
-package "php-mcrypt"
-package "php-mysql"
-package "php-pear"
-package "php-pgsql"
-package "php-sqlite3"
-
-package "pngcrush"
-package "pngquant"
-
-package "python"
-package "python-argparse"
-package "python-beautifulsoup"
-package "python-cheetah"
-package "python-dateutil"
-package "python-magic"
-package "python-psycopg2"
-package "python-gdal"
+package %w[
+ php
+ php-cgi
+ php-cli
+ php-curl
+ php-db
+ php-fpm
+ php-imagick
+ php-mcrypt
+ php-mysql
+ php-pear
+ php-pgsql
+ php-sqlite3
+]
+
+package %w[
+ pngcrush
+ pngquant
+]
+
+package %w[
+ python
+ python-argparse
+ python-beautifulsoup
+ python-cheetah
+ python-dateutil
+ python-magic
+ python-psycopg2
+ python-gdal
+]
passwords = data_bag_item("dns", "passwords")
passwords = data_bag_item("dns", "passwords")
-package "make"
-
-package "perl"
-package "libxml-treebuilder-perl"
-package "libxml-writer-perl"
-package "libyaml-perl"
-package "libwww-perl"
-package "libjson-xs-perl"
+package %w[
+ make
+ perl
+ libxml-treebuilder-perl
+ libxml-writer-perl
+ libyaml-perl
+ libwww-perl
+ libjson-xs-perl
+]
directory "/srv/dns.openstreetmap.org" do
owner "root"
directory "/srv/dns.openstreetmap.org" do
owner "root"
include_recipe "mysql"
include_recipe "git"
include_recipe "mysql"
include_recipe "git"
-package "php"
-package "php-cli"
-package "php-curl"
-package "php-mysql"
-package "php-gd"
+package %w[
+ php
+ php-cli
+ php-curl
+ php-mysql
+ php-gd
+]
# limitations under the License.
#
# limitations under the License.
#
-package "default-jre-headless"
-package "elasticsearch"
+package %w[
+ default-jre-headless
+ elasticsearch
+]
template "/etc/elasticsearch/elasticsearch.yml" do
source "elasticsearch.yml.erb"
template "/etc/elasticsearch/elasticsearch.yml" do
source "elasticsearch.yml.erb"
include_recipe "networking"
include_recipe "networking"
-package "exim4"
-package "openssl"
-package "ssl-cert"
+package %w[
+ exim4
+ openssl
+ ssl-cert
+]
package "exim4-daemon-heavy" if File.exist?("/var/run/clamav/clamd.ctl")
package "exim4-daemon-heavy" if File.exist?("/var/run/clamav/clamd.ctl")
passwords = data_bag_item("forum", "passwords")
passwords = data_bag_item("forum", "passwords")
-package "php"
-package "php-cli"
-package "php-mysql"
-package "php-xml"
-package "php-apcu"
+package %w[
+ php
+ php-cli
+ php-mysql
+ php-xml
+ php-apcu
+]
apache_module "php7.0"
apache_module "rewrite"
apache_module "php7.0"
apache_module "rewrite"
include_recipe "apache"
include_recipe "git"
include_recipe "apache"
include_recipe "git"
-package "ruby"
-package "ruby-dev"
+package %w[
+ ruby
+ ruby-dev
+]
# limitations under the License.
#
# limitations under the License.
#
-package "geoip-database-contrib"
-
-package "gdnsd"
+package %w[
+ geoip-database-contrib
+ gdnsd
+]
service "gdnsd" do
action [:enable, :start]
service "gdnsd" do
action [:enable, :start]
-package "make"
-package "build-essential"
-package "pkg-config"
-package "zlib1g-dev"
-package "libbz2-dev"
-package "libarchive-dev"
-package "libexpat1-dev"
-package "libpng-dev"
-package "pngquant"
-package "libcache-memcached-perl"
+package %w[
+ make
+ build-essential
+ pkg-config
+ zlib1g-dev
+ libbz2-dev
+ libarchive-dev
+ libexpat1-dev
+ libpng-dev
+ pngquant
+ libcache-memcached-perl
+]
directory "/srv/gps-tile.openstreetmap.org" do
owner "gpstile"
directory "/srv/gps-tile.openstreetmap.org" do
owner "gpstile"
include_recipe "git"
# Imagery gdal Requirements
include_recipe "git"
# Imagery gdal Requirements
-package "gdal-bin"
-package "python-gdal"
+package %w[
+ gdal-bin
+ python-gdal
+]
# Imagery MapServer + Mapcache Requirements
# Imagery MapServer + Mapcache Requirements
-package "cgi-mapserver"
-package "mapcache-cgi"
-package "mapcache-tools"
+package %w[
+ cgi-mapserver
+ mapcache-cgi
+ mapcache-tools
+]
# Mapserver via Nginx requires as fastcgi spawner
# Mapserver via Nginx requires as fastcgi spawner
-package "spawn-fcgi"
-package "multiwatch"
+package %w[
+ spawn-fcgi
+ multiwatch
+]
# Imagery processing Requirements
package "imagemagick"
# Imagery misc compression
# Imagery processing Requirements
package "imagemagick"
# Imagery misc compression
-package "xz-utils"
-package "unzip"
+package %w[
+ xz-utils
+ unzip
+]
directory "/srv/imagery/mapserver" do
owner "root"
directory "/srv/imagery/mapserver" do
owner "root"
keys = data_bag_item("chef", "keys")
keys = data_bag_item("chef", "keys")
-package "certbot"
-package "ruby"
+package %w[
+ certbot
+ ruby
+]
directory "/etc/letsencrypt" do
owner "letsencrypt"
directory "/etc/letsencrypt" do
owner "letsencrypt"
keys = data_bag_item("logstash", "keys")
keys = data_bag_item("logstash", "keys")
-package "default-jre-headless"
-package "logstash"
+package %w[
+ default-jre-headless
+ logstash
+]
cookbook_file "/var/lib/logstash/lumberjack.crt" do
source "lumberjack.crt"
cookbook_file "/var/lib/logstash/lumberjack.crt" do
source "lumberjack.crt"
include_recipe "git"
# Mediawiki Base Requirements
include_recipe "git"
# Mediawiki Base Requirements
-package "php"
-package "php-cli"
-package "php-curl"
-package "php-gd"
-package "php-intl"
-package "php-mbstring"
-package "php-mysql"
-package "php-xml"
+package %w[
+ php
+ php-cli
+ php-curl
+ php-gd
+ php-intl
+ php-mbstring
+ php-mysql
+ php-xml
+]
# Mediawiki enhanced difference engine
package "php-wikidiff2"
# Mediawiki Image + SVG support
# Mediawiki enhanced difference engine
package "php-wikidiff2"
# Mediawiki Image + SVG support
-package "imagemagick"
-package "librsvg2-bin"
+package %w[
+ imagemagick
+ librsvg2-bin
+]
# Mediawiki PDF support via Extension:PdfHandler
# Mediawiki PDF support via Extension:PdfHandler
-package "ghostscript"
-package "poppler-utils"
+package %w[
+ ghostscript
+ poppler-utils
+]
-package "xz-utils"
-package "liblz4-tool"
+package %w[
+ xz-utils
+ liblz4-tool
+]
# Mediawiki packages for VisualEditor support
# Mediawiki packages for VisualEditor support
-package "curl"
-package "parsoid"
+package %w[
+ curl
+ parsoid
+]
# Mediawiki packages for SyntaxHighight support
package "python-pygments"
# Mediawiki packages for SyntaxHighight support
package "python-pygments"
-package "ntp"
-package "ntpdate"
-package "tzdata"
+package %w[
+ ntp
+ ntpdate
+ tzdata
+]
execute "dpkg-reconfigure-tzdata" do
action :nothing
execute "dpkg-reconfigure-tzdata" do
action :nothing
# limitations under the License.
#
# limitations under the License.
#
-package "procps" do
- action :install
-end
directory "/etc/sysctl.d" do
owner "root"
directory "/etc/sysctl.d" do
owner "root"
include_recipe "passenger"
include_recipe "git"
include_recipe "passenger"
include_recipe "git"
-package "libsqlite3-dev"
-package "zlib1g-dev"
-package "libbz2-dev"
-package "libboost-dev"
-package "libexpat1-dev"
-package "libsparsehash-dev"
-package "libgd2-xpm-dev"
-package "libicu-dev"
-package "libboost-program-options-dev"
-package "cmake"
-package "make"
-package "g++"
-
-package "sqlite3"
-package "osmosis"
-package "curl"
-package "pbzip2"
+package %w[
+ libsqlite3-dev
+ zlib1g-dev
+ libbz2-dev
+ libboost-dev
+ libexpat1-dev
+ libsparsehash-dev
+ libgd2-xpm-dev
+ libicu-dev
+ libboost-program-options-dev
+ cmake
+ make
+ g++
+]
+
+package %w[
+ sqlite3
+ osmosis
+ curl
+ pbzip2
+]
ruby_version = node[:passenger][:ruby_version]
ruby_version = node[:passenger][:ruby_version]
-package "python-cairo"
-package "python-mapnik"
-package "python-setuptools"
+package %w[
+ python-cairo
+ python-mapnik
+ python-setuptools
+]
-package "fonts-noto-cjk"
-package "fonts-noto-hinted"
-package "fonts-noto-unhinted"
-package "fonts-hanazono"
-package "ttf-unifont"
+package %w[
+ fonts-noto-cjk
+ fonts-noto-hinted
+ fonts-noto-unhinted
+ fonts-hanazono
+ ttf-unifont
+]
["NotoSansArabicUI-Regular.ttf", "NotoSansArabicUI-Bold.ttf"].each do |font|
remote_file "/usr/share/fonts/truetype/noto/#{font}" do
["NotoSansArabicUI-Regular.ttf", "NotoSansArabicUI-Bold.ttf"].each do |font|
remote_file "/usr/share/fonts/truetype/noto/#{font}" do
-package "osm2pgsql"
-package "osmosis"
+package %w[
+ osm2pgsql
+ osmosis
+]
-package "ruby"
-package "ruby-dev"
+package %w[
+ ruby
+ ruby-dev
+]
-package "libproj-dev"
-package "libxml2-dev"
+package %w[
+ libproj-dev
+ libxml2-dev
+]
gem_package "proj4rb"
gem_package "libxml-ruby"
gem_package "proj4rb"
gem_package "libxml-ruby"
-package "xz-utils"
-package "openssl"
+package %w[
+ xz-utils
+ openssl
+]
# oathtool for QoS token
package "oathtool"
# oathtool for QoS token
package "oathtool"
-package "gcc"
-package "make"
-package "autoconf"
-package "automake"
-package "libboost-filesystem-dev"
-package "libboost-system-dev"
-package "libboost-program-options-dev"
+package %w[
+ gcc
+ make
+ autoconf
+ automake
+ libboost-filesystem-dev
+ libboost-system-dev
+ libboost-program-options-dev
+]
tilelog_source_directory = node[:tilelog][:source_directory]
tilelog_input_directory = node[:tilelog][:input_directory]
tilelog_source_directory = node[:tilelog][:source_directory]
tilelog_input_directory = node[:tilelog][:input_directory]
# limitations under the License.
#
# limitations under the License.
#
-package "bash-completion"
-package "dmidecode"
-package "ethtool"
-package "lsof"
-package "lsscsi"
-package "pciutils"
-package "screen"
-package "smartmontools"
-package "strace"
-package "sysstat"
-package "tcpdump"
-package "usbutils"
-package "numactl"
-package "xfsprogs"
-package "sysv-rc-conf"
-package "iotop"
-package "lvm2"
-package "rsyslog"
+package %w[
+ bash-completion
+ dmidecode
+ ethtool
+ lsof
+ lsscsi
+ pciutils
+ screen
+ smartmontools
+ strace
+ sysstat
+ tcpdump
+ usbutils
+ numactl
+ xfsprogs
+ sysv-rc-conf
+ iotop
+ lvm2
+ rsyslog
+]
service "rsyslog" do
action [:enable, :start]
service "rsyslog" do
action [:enable, :start]
-package "trac"
-package "trac-git"
-package "ruby"
+package %w[
+ trac
+ trac-git
+ ruby
+]
site_name = "trac.openstreetmap.org"
site_directory = "/srv/#{site_name}"
site_name = "trac.openstreetmap.org"
site_directory = "/srv/#{site_name}"
db_passwords = data_bag_item("db", "passwords")
db_passwords = data_bag_item("db", "passwords")
-package "gcc"
-package "make"
-package "pkg-config"
-package "libarchive-dev"
-package "libbz2-dev"
-package "libexpat1-dev"
-package "libgd2-noxpm-dev"
-package "libmemcached-dev"
-package "libpq-dev"
-package "zlib1g-dev"
+package %w[
+ gcc
+ make
+ pkg-config
+ libarchive-dev
+ libbz2-dev
+ libexpat1-dev
+ libgd2-noxpm-dev
+ libmemcached-dev
+ libpq-dev
+ zlib1g-dev
+]
gpx_directory = "#{node[:web][:base_directory]}/gpx-import"
pid_directory = node[:web][:pid_directory]
gpx_directory = "#{node[:web][:base_directory]}/gpx-import"
pid_directory = node[:web][:pid_directory]
include_recipe "apache"
include_recipe "mysql"
include_recipe "apache"
include_recipe "mysql"
-package "subversion"
-
-package "php"
-package "php-mysql"
+package %w[
+ subversion
+ php
+ php-mysql
+]
apache_module "php7.0"
apache_module "rewrite"
apache_module "php7.0"
apache_module "rewrite"
-package "php"
-package "php-cli"
-package "php-apcu"
+package %w[
+ php
+ php-cli
+ php-apcu
+]
# Required for osmosis
package "default-jre-headless"
# Required for building gosmore
# Required for osmosis
package "default-jre-headless"
# Required for building gosmore
-package "build-essential"
-package "libxml2-dev"
-package "libgtk2.0-dev"
-package "subversion"
-package "libcurl4-gnutls-dev"
-package "libgps-dev"
-package "libcurl3"
-package "buffer"
-package "git"
-package "cmake"
-package "libqt4-dev"
-package "qt4-dev-tools"
-package "qt4-linguist-tools"
-package "libicu-dev"
+package %w[
+ build-essential
+ libxml2-dev
+ libgtk2.0-dev
+ subversion
+ libcurl4-gnutls-dev
+ libgps-dev
+ libcurl3
+ buffer
+ git
+ cmake
+ libqt4-dev
+ qt4-dev-tools
+ qt4-linguist-tools
+ libicu-dev
+]