libre_ops.multi_redis
Multi-instance Redis
This is an Ansible role for setting up multiple Redis instances with customizable settings for each one.
You can find it on Ansible Galaxy.
Defaults
You can view the default settings that can be changed here (which includes helpful comments).
Setup
There are several adjustable default settings, but the main one is multiredis_instances
.
Here’s an example of how to configure 3 Redis instances for different parts of an application:
multiredis_instances:
- name: cache
port: 6380
configs: |
maxmemory 150mb
maxmemory-policy allkeys-lru
- name: jobs
port: 6381
configs: |
maxmemory 50mb
maxmemory-policy noeviction
appendonly yes
appendfsync everysec
- name: sessions
port: 6382
configs: |
maxmemory 100mb
maxmemory-policy volatile-lru
For more details on specific settings, check the Redis documentation here.
Example playbook
- name: Multi Redis
hosts: webservers
roles:
- role: libre_ops.multi_redis