community.cassandra.cassandra_status (1.3.3) — module

Validates the status of the cluster as seen from the node.

Authors: Rhys Campbell (@rhysmeister)

Install collection

Install with ansible-galaxy collection install community.cassandra:==1.3.3


Add to requirements.yml

  collections:
    - name: community.cassandra
      version: 1.3.3

Description

Validates the status of the cluster as seen from the C* node.

Ensure that all nodes are in a UP/NORMAL state or tolerate a few down nodes.

Optionally poll multiple times to allow the cluster state to stablise.

Cluster status is obtained thtough the usage of the nodetool status command.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Ensure all Cassandra nodes are in the UN (Up/Normal) state.
  community.cassandra.cassandra_status:
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Ensure all Cassandra nodes are in the UN (Up/Normal) state polling max 3 times, 60 seconds interval
  community.cassandra.cassandra_status:
    poll: 3
    interval: 60
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Ensure down nodes are no more than 1
  community.cassandra.cassandra_status:
    down: 1

Inputs

    
down:
    aliases:
    - d
    default: 0
    description:
    - The maximum number of nodes that can be tolerated as down.
    type: int

host:
    aliases:
    - login_host
    default: 127.0.0.1
    description:
    - The hostname.
    type: str

poll:
    default: 1
    description:
    - The maximum number of times to call nodetool status to query cluster status.
    type: int

port:
    aliases:
    - login_port
    default: 7199
    description:
    - The Cassandra TCP port.
    type: int

debug:
    default: false
    description:
    - Enable additional debug output.
    type: bool

interval:
    default: 30
    description:
    - The number of seconds to wait between poll executions.
    type: int

password:
    aliases:
    - login_password
    description:
    - The password to authenticate with.
    type: str

username:
    aliases:
    - login_user
    description:
    - The username to authenticate with.
    type: str

nodetool_path:
    description:
    - The path to nodetool.
    type: str

password_file:
    aliases:
    - login_password_file
    description:
    - Path to a file containing the password.
    type: str

nodetool_flags:
    default: -Dcom.sun.jndi.rmiURLParsing=legacy
    description:
    - Flags to pass to nodetool.
    type: str

Outputs

msg:
  description: A message indicating what has happened.
  returned: on success
  type: bool
rc:
  description: Return code of the last executed command.
  returned: always
  type: int