Skip to content

Install and configure a redis server, redis-cluster or redis-sentinel.

License

Notifications You must be signed in to change notification settings

bodsch/ansible-redis

Repository files navigation

Ansible Role: redis

Install and configure a *redis .

GitHub Workflow Status GitHub issues GitHub release (latest by date) Ansible Downloads

Requirements & Dependencies

Ansible Collections

ansible-galaxy collection install bodsch.core

or

ansible-galaxy collection install --requirements-file collections.yml

tested operating systems

Tested on

  • ArchLinux
  • ArtixLinux
  • Debian based
    • Debian 11
    • Ubuntu 20.04

usage

default configuration

see defaults/main.yml

redis_include_path: /etc/redis.d
redis_data_dir: /var/lib/redis

# general
redis_general:
  loglevel: notice
  logfile: /var/log/redis/redis-server.log
  databases: 16
  show_logo: true
  daemonize: true
  supervised: auto

# append_only
redis_append:
  only: false
  filename: appendonly.aof
  fsync: everysec

# memory_management
redis_memory:
  maxmemory: 0
  maxmemory_policy: noeviction
  maxmemory_samples: 5
  replica_ignore_maxmemory: true

# network
redis_network:
  bind:
    - 127.0.0.1
  port: 6379
  tcp_backlog: 511
  unixsocket: ''
  unixsocket_perm: 0700
  timeout: 300
  tcp_keepalive: 300

# replication
redis_replication:
  master_ip: ""
  master_port: 6379

# security
redis_security:
  requirepass: ""
  rename_commands: {}

# snapshotting
redis_snapshot:
  # Set to an empty set to disable persistence (saving the DB to disk).
  save:
    - 900 1
    - 300 10
    - 60 10000
  dbfilename: dump.rdb
  rdbcompression: false
  dbdir: "{{ redis_data_dir }}"

redis_sentinel:
  enabled: false
  state: started
  bind: "127.0.0.1"
  port: 26379
  protected_mode: false
  daemonize: false
  logfile: /var/log/redis/redis-sentinel.log
  cluster_name: redis_cluster
  master: ''
  announce_ip: ''

Author

  • Bodo Schulz

License

Apache

FREE SOFTWARE, HELL YEAH!