Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status


varnish (57) Versions 1.0.2

Installs and configures varnish

cookbook 'varnish', '= 1.0.2', :supermarket
cookbook 'varnish', '= 1.0.2'
knife supermarket install varnish
knife supermarket download varnish
Quality 0%

varnish Cookbook

Installs and configures varnish.



Tested on:

  • Ubuntu 12.04
  • Ubuntu 14.04
  • Debian 6.0
  • Centos 5.9
  • Centos 6.5
  • Centos 7.0


  • node['varnish']['dir'] - location of the varnish configuration directory
  • node['varnish']['default'] - location of the default file that controls the varnish init script on Debian/Ubuntu systems.
  • node['varnish']['version'] - If retrieving from official Varnish project repository, may choose 3.0 or 4.0.
  • node['varnish']['start'] - Should we start varnishd at boot? Set to "no" to disable (yes)
  • node['varnish']['nfiles'] - Open files (131072)
  • node['varnish']['memlock'] - Maxiumum locked memory size for shared memory log (82000)
  • node['varnish']['instance'] - Default varnish instance name (node['fqdn'])
  • node['varnish']['listen_address'] - Default address to bind to. Blank address (the default) means all IPv4 and IPv6 interfaces, otherwise specify a host name, an IPv4 dotted quad, or an IPv6 address in brackets
  • node['varnish']['listen_port'] - Default port to listen on (6081)
  • node['varnish']['vcl_conf'] - Name to use for main configuration file. (default.vcl.erb)
  • node['varnish']['vcl_source'] - Name for default configuration file template. (default.vcl)
  • node['varnish']['vcl_cookbook'] - Cookbook in which to look for the default.vcl.erb (or 'vcl_source' filename) template. This is used to specify custom template without modifying community cookbook files. (varnish)
  • node['varnish']['vcl_generated'] - Generate the varnish configuration using the supplied template. (true)
  • node['varnish']['conf_source'] - Name of the default system configuration file. (default.erb)
  • node['varnish']['conf_cookbook'] - Cookbook in which the default system configuration file is located. (varnish)
  • node['varnish']['secret_file'] - Path to a file containing a secret used for authorizing access to the management port. (/etc/varnish/secret)
  • node['varnish']['admin_listen_address'] - Telnet admin interface listen address (
  • node['varnish']['admin_listen_port'] - Telnet admin interface listen port (6082)
  • node['varnish']['user'] - Specifies the name of an unprivileged user to which the child process should switch before it starts accepting connections (varnish)
  • node['varnish']['group'] - Specifies the name of an unprivileged group to which the child process should switch before it starts accepting connections (varnish)
  • node['varnish']['ttl'] - Specifies a hard minimum time to live for cached documents. (120)
  • node['varnish']['storage'] - The storage type used ('file')
  • node['varnish']['storage_file'] - Specifies either the path to the backing file or the path to a directory in which varnishd will create the backing file. Only used if using file storage. ('/var/lib/varnish/$INSTANCE/varnish_storage.bin')
  • node['varnish']['storage_size'] - Specifies the size of the backing file or max memory allocation. The size is assumed to be in bytes, unless followed by one of the following suffixes: K,k,M,m,G,g,T,g,% (1G)
  • node['varnish']['log_daemon'] - Specifies if the system varnishlog daemon dumping all the varnish logs into /var/log/varnish/varnish.log should be enabled. (true)
  • node['varnish']['parameters'] = Set the parameter specified by param to the specified value. See Run-Time Parameters for a list of parameters. This option can be used multiple times to specifymultiple parameters.

If you don't specify your own vcl_conf file, then these attributes are used in the cookbook default.vcl template:

  • node['varnish']['backend_host'] = Host to serve/cache content from (localhost)
  • node['varnish']['backend_port'] = Port on backend host to access (8080)



Installs the varnish package, manages the default varnish configuration file, and the init script defaults file.


If placed before the default recipe in the run list, the official Varnish project apt repository will offer access to more version and platform support.


On systems that need a high performance caching server, use recipe[varnish]. Additional configuration can be done by modifying the default.vcl.erb and default.erb templates.

If running on a Redhat derivative then you may need to include yum-epel as it provides the jemalloc dependency that varnish needs

License & Authors

Copyright:: 2008-2009, Joe Williams

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
limitations under the License.

Dependent cookbooks

apt ~> 2.4
build-essential >= 0.0.0
yum ~> 3.0
yum-epel >= 0.0.0

Contingent cookbooks

magentostack Applicable Versions
nodestack Applicable Versions
noosfero Applicable Versions
phpstack Applicable Versions
pythonstack Applicable Versions
stack_commons Applicable Versions

varnish Cookbook CHANGELOG

This file is used to list changes made in each version of the varnish cookbook.

v0.9.12 (2014-03-12)

  • [COOK-4368] - Improve documentation to include all attributes





  • COOK-3095 - Add MiniTest Chef Handler and Test Kitchen



  • [COOK-2892]: Varnish restarts when vcl is updated instead of reloading


  • [COOK-1261] - fix issues with default.vcl handling


  • [COOK-873] - full daemon configuration through attributes
  • [COOK-1091] - fix path for default.vcl, via COOK-873
  • [COOK-1162] - add apt_repo recipe for using official varnish repository


  • Current public release.

Foodcritic Metric

1.0.2 failed this metric

FC031: Cookbook without metadata file: /tmp/cook/6bf2b9b184536b0a1770d0b0/varnish/metadata.rb:1
FC045: Consider setting cookbook name in metadata: /tmp/cook/6bf2b9b184536b0a1770d0b0/varnish/metadata.rb:1