| --- |
| - name: Show system.schema_keyspaces before changes |
| shell: "{{ cqlsh }} -e 'select * from system.schema_keyspaces' {{ private_address }}" |
| |
| - name: Set consistency to TWO to prepare for replication factor update |
| set_fact: |
| consistency: "TWO" |
| |
| - name: Keyspace before modification |
| shell: "{{ cqlsh }} -e 'DESCRIBE KEYSPACE {{ keyspace }}' {{ private_address }} | grep -C4 'CREATE KEYSPACE {{ keyspace }}'" |
| |
| - name: Construct CQL file |
| template: |
| src: update_replication_factor.cql.j2 |
| dest: /tmp/replication_factor.cql |
| |
| - name: Execute replication factor update |
| shell: "{{ cqlsh }} -f /tmp/replication_factor.cql {{ private_address }} " |
| |
| - name: Keyspace after modification |
| shell: "{{ cqlsh }} -e 'DESCRIBE KEYSPACE {{ keyspace }}' {{ private_address }} | grep -C4 'CREATE KEYSPACE {{ keyspace }}'" |
| |
| - name: Show system.schema_keyspaces after changes |
| shell: "{{ cqlsh }} -e 'select * from system.schema_keyspaces' {{ private_address }}" |