varnish

Varnish Module for AWS with Haproxy

Daniel Faria

danielfnfaria

7,199 downloads

7,179 latest version

1.5 quality score

Version information

  • 0.1.5 (latest)
  • 0.1.0
released Sep 12th 2015

Start using this module

Documentation

danielfnfaria/varnish — version 0.1.5 Sep 12th 2015

varnish

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.

Overview

This module will help you manage varnish servers with a standard template of what can happen it will create its VCL files simply.

Module Description

Control of:

  • Varnish
  • Haproxy

To run on AWS structure CNAME to your Load Balancers

Setup

What varnish affects

Basically controlled files are:

  • /etc/varnish/default.vcl + VCL's additional
  • /etc/varnish/secret
  • /etc/sysconfig/varnish
  • /etc/haproxy/haproxy.conf

Setup Requirements OPTIONAL

Require module concat

Beginning with varnish

The very basic steps needed for a user to get the module up and running.

If your most recent release breaks compatibility or requires particular steps for upgrading, you may wish to include an additional section here: Upgrading (For an example, see http://forge.puppetlabs.com/puppetlabs/firewall).

Usage

git clone https://github.com/danielfnfaria/varnish-puppet varnish

Reference

For add simple site:

  varnish::config {'site':
    host      => '127.0.0.1',# Send connections for haproxy in localhost
    port      => '8000', # Default port haproxy
    vhost     => 'site.com.br',
    custom_lb => 'lb.site.com.br', # Custom LB AWS CNAME
  }

For especific cache:

   cache     => [
     { 'url' =>  '/home/index.html', 'time' => '120' }, # Time in seconds
     { 'url' =>  '^(.*)\.jpg$',      'time' => '60'},   # Accept POSIX regex
   ]

For no cache especific locations:

   nocache   => [
     '/api/home',
     '/lock/google/api',
     '/translate/site/all'
   ]

Limitations

This module work's in Centos6 and Varnish 4, but the addition of debian is in development.

Development

To help make a pull-request