community.general.redis_data_info (8.5.0) — module

Get value of key in Redis database

| "added in version" 3.7.0 of community.general"

Authors: Andreas Botzner (@paginabianca)

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

Get value of keys in Redis database.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Get key foo=bar from loalhost with no username
  community.general.redis_data_info:
    login_host: localhost
    login_password: supersecret
    key: foo
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Get key foo=bar on redishost with custom ca-cert file
  community.general.redis_data_info:
    login_host: redishost
    login_password: supersecret
    login_user: somuser
    validate_certs: true
    ssl_ca_certs: /path/to/ca/certs
    key: foo

Inputs

    
key:
    description:
    - Database key.
    required: true
    type: str

tls:
    default: true
    description:
    - Specify whether or not to use TLS for the connection.
    type: bool

ca_certs:
    description:
    - Path to root certificates file. If not set and O(tls) is set to V(true), certifi
      ca-certificates will be used.
    type: str

login_host:
    default: localhost
    description:
    - Specify the target host running the database.
    type: str

login_port:
    default: 6379
    description:
    - Specify the port to connect to.
    type: int

login_user:
    description:
    - Specify the user to authenticate with.
    - Requires L(redis,https://pypi.org/project/redis) >= 3.4.0.
    type: str

login_password:
    description:
    - Specify the password to authenticate with.
    - Usually not used when target is localhost.
    type: str

validate_certs:
    default: true
    description:
    - Specify whether or not to validate TLS certificates.
    - This should only be turned off for personally controlled sites or with C(localhost)
      as target.
    type: bool

Outputs

exists:
  description: If they key exists in the database.
  returned: on success
  type: bool
msg:
  description: A short message.
  returned: always
  sample: 'Got key: foo with value: bar'
  type: str
value:
  description: Value key was set to.
  returned: if existing
  sample: value_of_some_key
  type: str

See also