redis_data
Set or remove a Redis key with optional expiration and existence conditions
Collection: community.general
Full Name: community.general.redis_data
Synopsis
Set or remove a Redis key with optional expiration and existence conditions
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| login_host | string | localhost | Redis server hostname | |
| login_port | int | 6379 | Redis server TCP port | |
| login_user | string | Redis ACL username | ||
| login_password | string | Redis authentication password; never included in errors | ||
| tls | bool | true | Connect using TLS | |
| validate_certs | bool | true | Validate the TLS server certificate | |
| ca_certs | string | PEM file containing trusted certificate authorities | ||
| client_cert_file | string | PEM client certificate file | ||
| client_key_file | string | PEM client private key file | ||
| key | string | yes | Database key | |
| value | string | Value required when state is present | ||
| state | string | present | Whether the key is present or absent | |
| expiration | int | Expiration in milliseconds; mutually exclusive with keep_ttl | ||
| non_existing | bool | Only set a missing key; mutually exclusive with existing | ||
| existing | bool | Only set an existing key | ||
| keep_ttl | bool | Retain the existing expiration |
Example
yaml
- name: Retrieve Redis information
community.general.redis_data:
login_host: localhost
tls: false
key: example
value: example-value