--- | |
- name: Playbook to remove a cassandra | |
hosts: "{{ target_hosts }}" | |
gather_facts: no | |
tasks: | |
- name: Assert variables exist | |
assert: | |
that: | |
- private_address is defined and private_address | trim | length > 0 | |
- nodetool is defined and nodetool | trim | length > 0 | |
- cassandra_thrift_client_port is defined and cassandra_thrift_client_port | trim | length > 0 | |
msg: "Please provide the missing attribute" | |
- name: Decommission cassandra node | |
shell: "{{ nodetool }} decommission" |