This role helps to deploy a Redis master or replication server on target host. This roles sets several default values for Redis configuration which can be overrriden by the user.
This role requires Ansible 1.4 or higher, and platform requirements are listed in the metadata file.
The variables that can be passed to this role and a brief description about them are as follows. See the documentation for Redis for details:
redis_bind_address # The network address for redis to bind to
redis_port: 6379 # Port for redis server
redis_syslog_enabled: "yes" # enable_syslog
redis_databases: 16 # Set number of databases
redis_database_save_times: # Save the DB on disk (seconds changes)
- [900, 1]
- [300, 10]
- [60, 10000]
redis_dbfilename: dump.rdb # Filename for the db
redis_db_dir: /var/lib/redis # DB directory
redis_role: master # The role for this redis deployment (master/slave)
redis_requirepass: false # If password is required for querying
redis_pass: None # Password if require_pass is enabled
redis_max_clients: 128
redis_max_memory: 512mb
redis_maxmemory_policy: volatile-lru
redis_appendfsync: everysec # How often to sync the filesystem
# If redis_role is "slave", set these values too
redis_master_ip: 1.1.1.1 # The master's IP
redis_master_port: 6379 # master port
redis_master_auth: None # master auth
# This isn't a redis setting, but if set to true, then the role won't try to
# change the kernel setting (useful for containers).
redis_no_vm_overcommit: false
The following example sets up a master Redis server.
- hosts: all
sudo: true
roles:
- {role: bennojoy.redis, redis_port: 11244}
The following example sets up a slave Redis server.
- hosts: all
sudo: true
roles:
- {role: bennojoy.redis,
redis_role: 'slave',
master_ip: '192.168.2.10',
master_auth: 'foobar'}
None
BSD
Benno Joy