davidalger.varnish
Ansible Role: Varnish Cache
This Ansible role installs Varnish Cache versions 4, 5, or 6 on RHEL / CentOS 8 and 7. It can be used for both single-instance and multi-instance setups, where you can have multiple named Varnish services on the same server. For more details on available versions, check out https://packagecloud.io/varnishcache/.
By default, this role sets up a VCL (Varnish Configuration Language) file designed for Magento 2. However, you can use a different VCL template by setting the varnish_vcl_template
variable to your template's path. Additionally, other tuning parameters for Varnish are pre-configured to better support the Magento 2 application.
Requirements
None.
Role Variables
You can find a list of variables to customize the service in defaults/main.yml
.
Example Usage
For a single Varnish instance:
- { role: davidalger.varnish, tags: varnish }
For multiple Varnish instances. In this case, the
varnish
service is disabled, and two services,varnish-site1
andvarnish-site2
, are set up:- { role: davidalger.varnish, tags: varnish, varnish_instance: { name: site1, port: 6081, admin_port: 6082 }} - { role: davidalger.varnish, tags: varnish, varnish_instance: { name: site2, port: 6091, admin_port: 6092 }}
License
This work is licensed under the MIT license. Check the LICENSE file for more information.
Author Information
This role was created by David Alger in 2017.
ansible-galaxy install davidalger.varnish