Code Monkey home page Code Monkey logo

ansible-role-varnish's Introduction

Ansible Role: Varnish

Build Status

An Ansible Role that installs Varnish on RedHat/CentOS or Debian/Ubuntu Linux.

Requirements

Requires the EPEL repository on RedHat/CentOS (you can install it using the geerlingguy.repo-epel role).

Role Variables

Available variables are listed below, along with default values (see defaults/main.yml):

varnish_version: "4.0"

Varnish version that should be installed. See https://repo.varnish-cache.org/redhat/ for a listing of available versions (e.g. 3.0, 4.0, 4.1).

varnish_config_path: /etc/varnish

The path in which Varnish configuration files will be stored.

varnish_use_default_vcl: true

Whether to use the included (simplistic) default Varnish VCL, using the backend host/port defined with the next two variables. Set this to false and copy your own default.vcl file into the varnish_config_path if you'd like to use a more complicated setup. If this variable is set to true, all other configuration will be taken from Varnish's own default VCL.

varnish_default_vcl_template_path: default.vcl.j2

The default VCL file to be copied (if varnish_use_default_vcl is true). Defaults the the simple template inside templates/default.vcl.j2. This path should be relative to the directory from which you run your playbook.

varnish_default_backend_host: "127.0.0.1"
varnish_default_backend_port: "8080"

Some settings for the default "default.vcl" template that will be copied to the varnish_config_path folder. The default backend host/port could be Apache or Nginx (or some other HTTP server) running on the same host or some other host (in which case, you might use port 80 instead).

varnish_listen_port: "80"

The port on which Varnish will listen (typically port 80).

varnish_secret: "14bac2e6-1e34-4770-8078-974373b76c90"

The secret/key to be used for connecting to Varnish's admin backend (for purge requests, etc.).

varnish_admin_listen_host: "127.0.0.1"
varnish_admin_listen_port: "6082"

The host and port through which Varnish will accept admin requests (like purge and status requests).

varnish_storage: "file,/var/lib/varnish/varnish_storage.bin,256M"

How Varnish stores cache entries (this is passed in as the argument for -s). If you want to use in-memory storage, change to something like malloc,256M. Please read Varnish's Getting Started guide for more information.

Dependencies

None.

Example Playbook

- hosts: webservers
  vars_files:
    - vars/main.yml
  roles:
    - role: geerlingguy.varnish

Inside vars/main.yml:

varnish_secret: "[secret generated by uuidgen]"
varnish_default_backend_host: 81
... etc ...

License

MIT / BSD

Author Information

This role was created in 2014 by Jeff Geerling, author of Ansible for DevOps.

ansible-role-varnish's People

Contributors

geerlingguy avatar nickhammond avatar sanchiz avatar sredhar avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.