New in version 1.3.
| parameter | required | default | choices | comments |
|---|---|---|---|---|
| command | yes |
| The selected redis command | |
| db | no | The database to flush (used in db mode) [flush command] | ||
| flush_mode | no | all |
| Type of flush (all the dbs in a redis instance or a specific one) [flush command] |
| login_host | no | localhost | The host running the database | |
| login_password | no | The password used to authenticate with (usually not used) | ||
| login_port | no | 6379 | The port to connect to | |
| master_host | no | The host of the master instance [slave command] | ||
| master_port | no | The port of the master instance [slave command] | ||
| name (added in 1.6)
| no | A redis config key. | ||
| slave_mode | no | slave |
| the mode of the redis instance [slave command] |
| value (added in 1.6)
| no | A redis config value. |
# Set local redis instance to be slave of melee.island on port 6377
- redis:
command: slave
master_host: melee.island
master_port: 6377
# Deactivate slave mode
- redis:
command: slave
slave_mode: master
# Flush all the redis db
- redis:
command: flush
flush_mode: all
# Flush only one db in a redis instance
- redis:
command: flush
db: 1
flush_mode: db
# Configure local redis to have 10000 max clients
- redis:
command: config
name: maxclients
value: 10000
# Configure local redis to have lua time limit of 100 ms
- redis:
command: config
name: lua-time-limit
value: 100
Note
This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.
For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Testing Ansible and Developing Modules.
© 2012–2017 Michael DeHaan
© 2017 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/redis_module.html