New in version 2.5.
The below requirements are needed on the local master node that executes this lookup.
Parameter | Choices/Defaults | Configuration | Comments |
---|---|---|---|
_terms |
list of keys to query
|
||
host |
Default: "127.0.0.1"
|
ini entries:
[lookup_redis ] env:ANSIBLE_REDIS_HOST
|
location of Redis host
|
port
int |
Default: "6379A"
|
ini entries:
[lookup_redis ] env:ANSIBLE_REDIS_PORT
|
port on which Redis is listening on
|
socket
path |
ini entries:
[lookup_redis ] env:ANSIBLE_REDIS_SOCKET
|
path to socket on which to query Redis, this option overrides host and port options when set.
|
- name: query redis for somekey (default or configured settings used)
debug: msg="{{ lookup('redis', 'somekey'}}"
- name: query redis for list of keys and non-default host and port
debug: msg="{{ lookup('redis', item, host='myredis.internal.com', port=2121) }}"
loop: '{{list_of_redis_keys}}'
- name: use list directly
debug: msg="{{ lookup('redis', 'key1', 'key2', 'key3') }}"
- name: use list directly with a socket
debug: msg="{{ lookup('redis', 'key1', 'key2', socket='/var/tmp/redis.sock') }}"
Common return values are documented here, the following are the fields unique to this lookup:
Key | Returned | Description |
---|---|---|
_raw
|
value(s) stored in Redis
|
Hint
If you notice any issues in this documentation you can edit this document to improve it.