community.general.redis – Various redis commands, slave and flush¶
Note
This plugin is part of the community.general collection (version 1.3.6).
To install it use: ansible-galaxy collection install community.general
.
To use it in a playbook, specify: community.general.redis
.
Parameters¶
Notes¶
Note
Requires the redis-py Python package on the remote host. You can install it with pip (pip install redis) or with a package manager. https://github.com/andymccurdy/redis-py
If the redis master instance we are making slave of is password protected this needs to be in the redis.conf in the masterauth variable
See Also¶
See also
- community.general.redis_info
The official documentation on the community.general.redis_info module.
Examples¶
- name: Set local redis instance to be slave of melee.island on port 6377
community.general.redis:
command: slave
master_host: melee.island
master_port: 6377
- name: Deactivate slave mode
community.general.redis:
command: slave
slave_mode: master
- name: Flush all the redis db
community.general.redis:
command: flush
flush_mode: all
- name: Flush only one db in a redis instance
community.general.redis:
command: flush
db: 1
flush_mode: db
- name: Configure local redis to have 10000 max clients
community.general.redis:
command: config
name: maxclients
value: 10000
- name: Configure local redis maxmemory to 4GB
community.general.redis:
command: config
name: maxmemory
value: 4GB
- name: Configure local redis to have lua time limit of 100 ms
community.general.redis:
command: config
name: lua-time-limit
value: 100
Authors¶
Xabier Larrakoetxea (@slok)