Forge Home


Install and configure Varnish Cache


26,270 latest version

4.9 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 3.0.0 (latest)
  • 2.4.1
  • 2.4.0
  • 2.3.0
  • 2.2.0
  • 2.1.2
  • 2.1.1
  • 2.1.0
  • 2.0.0
  • 1.1.0
  • 1.0.0
released Jul 20th 2015
This version is compatible with:
  • Puppet Enterprise 3.x
  • Puppet >= 3.1.0
  • , , , , ,
This module has been deprecated by its author since Mar 9th 2023.

The author has suggested claranet-varnish as its replacement.

Start using this module

Tags: varnish, cache, http


bashtoni/varnish — version 3.0.0 Jul 20th 2015



Table of Contents

  1. Overview
  2. Module Description - What the module does and why it is useful
  3. Setup - The basics of getting started with Varnish
  4. Usage - Configuration options and additional functionality
  5. Reference - An under-the-hood peek at what the module is doing and how
  6. Limitations - OS compatibility, etc.
  7. Development - Guide for contributing to the module


Installs and configures Varnish. Requires you to have a VCL specified in a parameter.

Module Description


  • Varnish 3 and 4 on EL6 and derivatives (RHEL, CentOS, OEL, Amazon Linux)
  • Varnish 3 on Ubuntu 12.04
  • Varnish 3 on Debian 7
  • Varnish 4 on EL7 and derivatives
  • Varnish 4 on Ubuntu 14.04
  • Varnish 4 on Debian 7 and 8

Requires Puppet >= 3.0


This module will install Varnish, by default from the official Varnish repos.

Beginning with Varnish

  class { 'varnish':
    secret => '6565bd1c-b6d1-4ba3-99bc-3c7a41ffd94f',

  varnish::vcl { '/etc/varnish/default.vcl':
    content => template('data/varnish/default.vcl.erb'),


All parameters are optional, but at minimum it is suggested you set a secret.

Parameter Description
addrepo Whether to add the official Varnish repos
varnish_version Major Varnish version - should be 3.0 or 4.0
secret Secret for admin access
secret_file File to store the secret
vcl_conf Varnish vcl config file path
listen IP to bind to
listen_port TCP port to listen on
admin_listen Admin IP to bind to
admin_port TCP port for admin to listen on
min_threads Minimum Varnish worker threads
max_threads Maximum Varnish worker threads
thread_timeout Terminate threads after this long idle
storage_type malloc or file
storage_file File to mmap on disk for cache storage
storage_size Size of storage file or RAM, eg 10G or 50%
package_ensure Version of Varnish package to install, eg 3.0.5-1.el6
runtime_params hash of run-time parameters to be specified at startup



Before making any changes, please run bundle install and then bundle exec rake test to ensure all tests pass.

Once you have completed your change, run bundle exec rake test to run the tests again and ensure you haven't broken any existing functionality. If you've added new functionality, please add tests for this.

We try extremely hard not to break existing functionality, and so pull requests which do so are unlikely to be accepted.