| --- |
| - name: Validate that local_quorum is provided |
| fail: |
| msg: Please indicate whether local_quorum yes or no |
| when: local_quorum is not defined |
| |
| - debug: var=local_quorum |
| |
| - set_fact: |
| lq: "{{ bool(local_quorum) }}" |
| |
| - debug: var=lq |
| |
| - name: Set consistency when local_quorum is set |
| set_fact: |
| consistency: 'LOCAL_QUORUM' |
| when: local_quorum is defined and local_quorum in ['yes', 'true', 'True', 'no', 'No', 'False'] |
| |
| - name: Set consistency when local_quorum is not set |
| set_fact: |
| consistency: 'QUORUM' |
| when: local_quorum | default(false) |
| |
| - name: Construct CQL file |
| template: |
| src: quorum.cql.j2 |
| dest: /tmp/quorum.cql |
| |
| - name: Update QUORUM settings |
| shell: "{{ apigee_installation_home }}/apigee-cassandra/bin/cqlsh -f /tmp/quorum.cql {{ local_address }} " |