removed unused template
diff --git a/tasks/keyspace.yml b/tasks/keyspace.yml index a6f00c1..480df90 100644 --- a/tasks/keyspace.yml +++ b/tasks/keyspace.yml
@@ -4,11 +4,11 @@ - name: Construct CQL file template: - src: alter_replication_factor.cql.j2 - dest: /tmp/alter_replication_factor.cql + src: replication_factor.cql.j2 + dest: /tmp/replication_factor.cql - name: Execute CQL statements - shell: "{{ apigee_installation_home }}/apigee-cassandra/bin/cqlsh -f /tmp/alter_replication_factor.cql {{ local_address }} " + shell: "{{ apigee_installation_home }}/apigee-cassandra/bin/cqlsh -f /tmp/replication_factor.cql {{ local_address }} " - name: Keyspace after modification shell: "{{ apigee_installation_home }}/apigee-cassandra/bin/cqlsh -e 'DESCRIBE KEYSPACE {{ keyspace }}' {{ local_address }} | grep -C3 'CREATE KEYSPACE {{ keyspace }}'"
diff --git a/tasks/main.yml b/tasks/main.yml index e2f1761..7d7f982 100644 --- a/tasks/main.yml +++ b/tasks/main.yml
@@ -10,12 +10,14 @@ msg: Please indicate the replication_factor to use when: replication_factor is not defined -- name: Validate that consistency is provided +- name: Validate that local_quorum is provided fail: - msg: Please indicate the consistency to use - when: consistency is not defined + msg: Please indicate whether local_quorum yes or no + when: local_quorum is not defined - include: keyspace.yml with_items: '{{ keyspaces }}' loop_control: loop_var: keyspace + +- include: quorum.yml
diff --git a/tasks/quorum.yml b/tasks/quorum.yml new file mode 100644 index 0000000..1627053 --- /dev/null +++ b/tasks/quorum.yml
@@ -0,0 +1,8 @@ +--- +- 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 }} "
diff --git a/templates/quorum.cql.j2 b/templates/quorum.cql.j2 new file mode 100644 index 0000000..c98d478 --- /dev/null +++ b/templates/quorum.cql.j2
@@ -0,0 +1 @@ +CONSISTENCY {{ consistency }};
diff --git a/templates/alter_replication_factor.cql.j2 b/templates/replication_factor.cql.j2 similarity index 83% rename from templates/alter_replication_factor.cql.j2 rename to templates/replication_factor.cql.j2 index 1690224..181a6a2 100644 --- a/templates/alter_replication_factor.cql.j2 +++ b/templates/replication_factor.cql.j2
@@ -1,3 +1 @@ ALTER KEYSPACE {{ keyspace }} WITH REPLICATION = { 'class': 'NetworkTopologyStrategy', 'dc-1': {{ replication_factor }}, 'dc-2': {{ replication_factor }} }; - -CONSISTENCY {{ consistency }};