ANSIBLE.REDIS(3)

NAME
redis - Various redis commands, slave and flush

DESCRIPTION

Unified utility to interact with redis instances. 'slave' Sets a redis instance in slave or master mode. 'flush' Flushes all the instance or a specified db.

OPTIONS

command
    The selected redis command Choices: slave,flush.(required)

db  The database to flush (used in db mode) [flush command]

flush_mode
    Type of flush (all the dbs in a redis instance or a specific one) [flush command] Choices: all,db. (default: all)

login_host
    The host running the database (default: localhost)

login_password
    The password used to authenticate with (usually not used)

login_port
    The port to connect to (default: 6379)

master_host
    The host of the master instance [slave command]

master_port
    The port of the master instance [slave command]

slave_mode
    the mode of the redis instance [slave command] Choices: master,slave. (default: slave).

NOTES

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

EXAMPLES
# 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

AUTHOR
Xabier Larrakoetxea

SEE ALSO
ansible(1), http://ansible.github.com/modules.html#redis