Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

⚠️ PLEASE NOTE: This role has been migrated to our hifis.toolkit collection. ⚠️ Ansible role for setting up a highly available Redis cluster.

License

Notifications You must be signed in to change notification settings

hifis-net/ansible-role-redis

Repository files navigation

Redis Ansible Role

⚠️ This project is archived! ⚠️

This role has been migrated to our hifis.toolkit collection:

CI Status Ansible Role: hifis.redis Ansible Role Downloads Apache-2.0 Licensed Latest release DOI

A role to set up Redis instances to be used as caching servers in a high availability and scalability context.

Currently supported platforms are:

  • Ubuntu 20.04 LTS
  • Ubuntu 22.04 LTS

Requirements

None.

Role Variables

The Redis version to install:

redis_version: '7.2.1'

Specifies whether the current node is master, or a replica instance:

redis_instance_type: 'master'

The IP address to bind Redis to:

redis_instance_ip: "127.0.0.1"

The Redis Master instance IP address:

redis_master_instance_ip: "{{ redis_instance_ip if redis_instance_type == 'master' else None }}"

The name of the Redis cluster monitored by Sentinel:

redis_cluster_name: 'redis-cluster'

Password used to authenticate in the Redis cluster:

redis_password: 'changeme'

List of dependent packages required by Redis Server:

redis_dependencies:
  - 'build-essential'

URL from which Redis Server can be downloaded:

redis_download_url: "https://download.redis.io/releases/redis-{{ redis_version }}.tar.gz"

File path to the Redis Server binary:

redis_bin: '/usr/local/bin/redis-server'

File path to the directory in which Redis Server is build:

redis_build_dir: '/usr/local/src/redis-{{ redis_version }}'

Directory into which Redis service files are copied:

redis_systemd_dir: '/etc/systemd/system'

Redis Server service file path:

redis_server_service_file: '{{ redis_systemd_dir }}/redis-server.service'

Redis Sentinel service file path:

redis_sentinel_service_file: '{{ redis_systemd_dir }}/redis-sentinel.service'

Password for Redis Sentinel. This is unset by default.

redis_sentinel_password: 'changeme'

Redis configuration directory path:

redis_configuration_dir: '/etc/redis'

Path to Redis Server configuration file:

redis_server_configuration_file: '{{ redis_configuration_dir }}/redis.conf'

Path to Redis Sentinel configuration file:

redis_sentinel_configuration_file: '{{ redis_configuration_dir }}/sentinel.conf'

Redis library directory:

redis_lib_dir: '/var/lib/redis'

Redis logging directory:

redis_log_dir: '/var/log/redis'

Path to Redis Server log file:

redis_server_log_file_path: "{{ redis_log_dir }}/redis-server.log"

Path to Redis Sentinel log file:

redis_sentinel_log_file_path: "{{ redis_log_dir }}/redis-sentinel.log"

Redis log level, can be one of: debug, verbose, notice, warning:

redis_log_level: 'notice'

Sentinel log level, can be one of: debug, verbose, notice, warning:

sentinel_log_level: 'notice'

Enable/disable Redis Server protected mode:

redis_protected_mode: 'yes'

Enable/disable Redis Sentinel protected mode:

sentinel_protected_mode: 'yes'

Redis username:

redis_user: 'redis'

Redis group name:

redis_group: 'redis'

Redis Server service name:

redis_server_service_name: 'redis-server'

Redis Sentinel service name:

redis_sentinel_service_name: 'redis-sentinel'

Dependencies

None.

Example Playbook

- hosts: servers
  roles:
    - role: hifis.redis

License

Apache-2.0

Author Information

HIFIS Software Team