diff --git a/ansible/inventory/env/group_vars/all.yml b/ansible/inventory/env/group_vars/all.yml
index 2c78e738b84b9ac8e821ae4e14439ae243ed6fed..c239c5cfd4d1bbe53e1a26345b7ffc1731db27b1 100644
--- a/ansible/inventory/env/group_vars/all.yml
+++ b/ansible/inventory/env/group_vars/all.yml
@@ -657,3 +657,6 @@ dp_postgres_host: "{{ groups['postgres'][0] }}"
 dp_postgres_db: analytics
 dp_postgres_password: "{{ core_vault_dp_pgdb_password }}"
 dp_postgres_username: analytics
+
+# Will enable cassandra cluster if number of cassandra nodes > 1
+cassandra_cluster_size: "{{ groups['cassandra'] | length }}"
diff --git a/ansible/roles/cassandra-cql-update/templates/cassandra.cql b/ansible/roles/cassandra-cql-update/templates/cassandra.cql
index d4ff7026cce401fe4175f380b8fcc6bca2a7fbc1..c20e9924db99bbd7d2672204dd23115c9119df00 100644
--- a/ansible/roles/cassandra-cql-update/templates/cassandra.cql
+++ b/ansible/roles/cassandra-cql-update/templates/cassandra.cql
@@ -1,4 +1,4 @@
-{% if groups['cassandra-2'] is defined %}
+{% if (cassandra_cluster_size | int) > 1 %}
 CREATE KEYSPACE IF NOT EXISTS sunbird WITH REPLICATION = { 'class' : 'NetworkTopologyStrategy', 'datacenter1' : 2 };
 {% else %}
 CREATE KEYSPACE IF NOT EXISTS sunbird WITH REPLICATION = {'class':'SimpleStrategy','replication_factor':1};
@@ -11,7 +11,7 @@ USE sunbird;
 
 /*
 creation of id= one way hash of (userId##courseId) here courseId is identifier of course mgmt table
-toc url we have to generate through json of content id from ekStep 
+toc url we have to generate through json of content id from ekStep
 here status is (default(0),inProgress(1),completed(2))
 progress is no of content completed
 */
@@ -37,13 +37,13 @@ CREATE INDEX inx_cc_status ON sunbird.content_consumption (status);
 CREATE INDEX inx_cc_courseId ON sunbird.content_consumption (courseId);
 
 /*
-creation of id = using timestamp and env 
+creation of id = using timestamp and env
  id and courseId both are same
-content id is from ekstep 
+content id is from ekstep
 status DRAFT("draft"), LIVE("live"), RETIRED("retired")
 contentType (pdf,video,word doc etc)
 tutor   map<id,name>
-*/      
+*/
 CREATE TABLE IF NOT EXISTS sunbird.course_management(id text, courseId text, contentId text, courseName text,courseType text,
 facultyId text,facultyName text,organisationId text,organisationName text,enrollementStartDate text,enrollementEndDate text,
 courseDuration text,description text,status text,addedBy text,addedByName text,publishedBy text,publishedByName text,createdDate text,
@@ -86,7 +86,7 @@ updatedDate text,updatedBy text,status int,parentOrgId text,orgType text,orgCode
 CREATE INDEX inx_org_orgName ON sunbird.organisation (orgName);
 CREATE INDEX inx_org_status ON sunbird.organisation (status);
 //page_management
-//id=  using timestamp and env 
+//id=  using timestamp and env
 CREATE TABLE IF NOT EXISTS sunbird.page_management(id text, name text, appMap text,portalMap text,createdDate text,createdBy text,
 updatedDate text,updatedBy text,organisationId text,PRIMARY KEY (id));
 
@@ -94,14 +94,14 @@ CREATE INDEX inx_pm_pageName ON sunbird.page_management (name);
 CREATE INDEX inx_vm_organisationId ON sunbird.page_management (organisationId);
 
 //page_section
-//id=  using timestamp and env 
+//id=  using timestamp and env
 CREATE TABLE IF NOT EXISTS sunbird.page_section(id text, name text, sectionDataType text,description text,display text,
 searchQuery text,createdDate text,createdBy text,updatedDate text,updatedBy text,imgUrl text,alt text,status int,PRIMARY KEY (id));
 CREATE INDEX inx_ps_sectionDataType ON sunbird.page_section (sectionDataType);
 CREATE INDEX inx_ps_sectionName ON sunbird.page_section (name);
 
 //Assessment Eval
-//id=  using timestamp and env 
+//id=  using timestamp and env
 CREATE TABLE IF NOT EXISTS sunbird.assessment_eval(id text, contentId text, courseId text, userId text,
 createdDate text,result text,score text,attemptId text,attemptedCount int,PRIMARY KEY (id));
 
@@ -109,7 +109,7 @@ CREATE INDEX inx_ae_userId ON sunbird.assessment_eval (userId);
 CREATE INDEX inx_ae_contentId ON sunbird.assessment_eval (contentId);
 CREATE INDEX inx_ae_courseId ON sunbird.assessment_eval (courseId);
 
-//Assessment item 
+//Assessment item
 //id= using timestamp and userId
 CREATE TABLE IF NOT EXISTS sunbird.assessment_item(id text, contentId text, courseId text, userId text,assessmentItemId text,
 assessmentType text,attemptedDate text,createdDate text,timeTaken int,result text,score text,maxScore text,answers text,
@@ -121,10 +121,10 @@ CREATE INDEX inx_ai_assessmentItemId ON sunbird.assessment_item (assessmentItemI
 CREATE INDEX inx_ai_courseId ON sunbird.assessment_item (courseId);
 CREATE INDEX inx_ai_processingStatus ON sunbird.assessment_item (processingStatus);
 
-DROP INDEX IF EXISTS sunbird.inx_ai_processingStatus; 
+DROP INDEX IF EXISTS sunbird.inx_ai_processingStatus;
 DROP INDEX IF EXISTS sunbird.inx_ae_assessmentitemid;
 
- 
+
 CREATE TABLE IF NOT EXISTS sunbird.user_external_identity(id text, userId text, externalId text,source text,isVerified boolean,PRIMARY KEY (id));
 CREATE INDEX inx_uei_userid ON sunbird.user_external_identity (userId);
 CREATE INDEX inx_uei_externalId ON sunbird.user_external_identity (externalId);
@@ -139,15 +139,15 @@ CREATE TABLE IF NOT EXISTS sunbird.user_education(id text, userId text, courseNa
 CREATE INDEX inx_ueu_userid ON sunbird.user_education (userId);
 
 CREATE TABLE IF NOT EXISTS sunbird.user_job_profile(id text, userId text, jobName text,role text,joiningDate text,endDate text,orgName text,orgId text,subject list<text>,addressId text,boardName text,isVerified boolean,isRejected boolean,verifiedDate text,verifiedBy text,createdDate text,createdBy text,updatedDate text,updatedBy text, PRIMARY KEY (id));
-CREATE INDEX inx_ujp_userid ON sunbird.user_job_profile (userId); 
+CREATE INDEX inx_ujp_userid ON sunbird.user_job_profile (userId);
 
 CREATE TABLE IF NOT EXISTS sunbird.user_org(id text, userId text, role text,orgId text,orgJoinDate text,orgLeftDate text,isApproved boolean,
 isRejected boolean,approvedBy text,approvalDate text,updatedDate text,updatedBy text, PRIMARY KEY (id));
-CREATE INDEX inx_uorg_userid ON sunbird.user_org(userId); 
+CREATE INDEX inx_uorg_userid ON sunbird.user_org(userId);
 CREATE INDEX inx_uorg_orgId ON sunbird.user_org(orgId);
- 
+
 CREATE TABLE IF NOT EXISTS sunbird.subject(id text, name text, PRIMARY KEY (id));
-CREATE INDEX inx_sb_name ON sunbird.subject(name); 
+CREATE INDEX inx_sb_name ON sunbird.subject(name);
 
 
 ALTER TABLE sunbird.organisation ADD imgUrl text;
@@ -165,14 +165,14 @@ ALTER TABLE sunbird.organisation ADD approvedDate text;
 
 CREATE INDEX inx_org_channel ON sunbird.organisation(channel);
 CREATE INDEX inx_org_orgType ON sunbird.organisation(orgType);
-CREATE INDEX inx_org_orgCode ON sunbird.organisation(orgCode); 
+CREATE INDEX inx_org_orgCode ON sunbird.organisation(orgCode);
 
 CREATE TABLE IF NOT EXISTS sunbird.org_type(id text, name text, PRIMARY KEY (id));
-CREATE INDEX inx_ot_name ON sunbird.org_type(name);  
+CREATE INDEX inx_ot_name ON sunbird.org_type(name);
 
 CREATE TABLE IF NOT EXISTS sunbird.org_mapping(id text, orgIdOne text,relation text,orgIdTwo text, PRIMARY KEY (id));
-CREATE INDEX inx_om_orgIdOne ON sunbird.org_mapping(orgIdOne);  
-CREATE INDEX inx_om_orgIdTwo ON sunbird.org_mapping(orgIdTwo);    
+CREATE INDEX inx_om_orgIdOne ON sunbird.org_mapping(orgIdOne);
+CREATE INDEX inx_om_orgIdTwo ON sunbird.org_mapping(orgIdTwo);
 
 ALTER TABLE sunbird.user ADD rootOrgId text;
 ALTER TABLE sunbird.address ADD addressLine1 text;
@@ -180,7 +180,7 @@ ALTER TABLE sunbird.address ADD addressLine2 text;
 ALTER TABLE sunbird.user_education ADD degree text;
 
 CREATE TABLE IF NOT EXISTS sunbird.master_action(id text, name text, PRIMARY KEY (id));
-CREATE INDEX inx_ma_name ON sunbird.master_action(name); 
+CREATE INDEX inx_ma_name ON sunbird.master_action(name);
 
 CREATE TABLE IF NOT EXISTS sunbird.action_group(id text, actionId list<text>,groupName text, PRIMARY KEY (id));
 CREATE INDEX inx_uacg_groupName ON sunbird.action_group(groupName);
@@ -190,12 +190,12 @@ CREATE INDEX inx_uactr_roleId ON sunbird.user_action_role(roleId);
 
 
 insert into sunbird.action_group(id,actionId,groupName) values ('ag_12',['1','2'],'SYSTEM_ADMINISTRATION');
-insert into sunbird.action_group(id,actionId,groupName) values ('ag_13',['3','4','7','8','5'],'ORG_MANAGEMENT');	
-insert into sunbird.action_group(id,actionId,groupName) values ('ag_14',['6','9','10'],'MEMBERSHIP_MANAGEMENT');	
+insert into sunbird.action_group(id,actionId,groupName) values ('ag_13',['3','4','7','8','5'],'ORG_MANAGEMENT');
+insert into sunbird.action_group(id,actionId,groupName) values ('ag_14',['6','9','10'],'MEMBERSHIP_MANAGEMENT');
 
 insert into sunbird.action_group(id,actionId,groupName) values ('ag_15',['11','12','13','14'],'CONTENT_CREATION');
-insert into sunbird.action_group(id,actionId,groupName) values ('ag_16',['15','16'],'CONTENT_REVIEW');	
-insert into sunbird.action_group(id,actionId,groupName) values ('ag_17',['17','18','10'],'CONTENT_CURATION');		
+insert into sunbird.action_group(id,actionId,groupName) values ('ag_16',['15','16'],'CONTENT_REVIEW');
+insert into sunbird.action_group(id,actionId,groupName) values ('ag_17',['17','18','10'],'CONTENT_CURATION');
 insert into sunbird.action_group(id,actionId,groupName) values ('ag_17',['19','20','21','22','23','24','25','26'],'PUBLIC');
 
 ALTER TABLE sunbird.user ADD loginId text;
@@ -208,12 +208,12 @@ insert into  sunbird.user_action_role(id,actiongroupid,roleid) values ('uar_3',[
  insert into sunbird.user_action_role(id,actiongroupid,roleid) values ('uar_3',['ag_15'],'r_104');
  insert into sunbird.user_action_role(id,actiongroupid,roleid) values ('uar_3',['ag_16'],'r_105');
  insert into sunbird.user_action_role(id,actiongroupid,roleid) values ('uar_3',['ag_12'],'r_101');
- 
+
 ALTER TABLE sunbird.organisation DROP addId;
 ALTER TABLE sunbird.organisation ADD addressId text;
 ALTER TABLE sunbird.user ADD roles List<text>;
- 
- 
+
+
  CREATE TABLE IF NOT EXISTS sunbird.role_group(id text, name text, PRIMARY KEY (id));
  insert into sunbird.role_group (id,name) values ('SYSTEM_ADMINISTRATION','System Administration');
  insert into sunbird.role_group (id,name) values ('ORG_MANAGEMENT','Org Management');
@@ -229,7 +229,7 @@ CREATE INDEX inx_ro_master_name ON sunbird.role(name);
  insert into sunbird.role (id,name,rolegroupid,status) values ('ORG_MODERATOR','Org Moderator',['MEMBERSHIP_MANAGEMENT'],1);
  insert into sunbird.role (id,name,rolegroupid,status) values ('CONTENT_CREATOR','Content Creator',['CONTENT_CREATION'],1);
  insert into sunbird.role (id,name,rolegroupid,status) values ('CONTENT_REVIEWER','Content Reviewer',['CONTENT_CREATION','CONTENT_CURATION','CONTENT_REVIEW'],1);
- 
+
  CREATE TABLE IF NOT EXISTS sunbird.url_action(id text, url list<text>,name text, PRIMARY KEY (id));
  CREATE INDEX inx_ua_name ON sunbird.url_action(name);
 CREATE INDEX inx_ua_url ON sunbird.url_action(url);
@@ -255,7 +255,7 @@ insert into sunbird.url_action (id,name) values ('suspendOrg','suspendOrg');
  insert into sunbird.url_action (id,name) values ('publishCourse','publishCourse');
  insert into sunbird.url_action (id,name) values ('publishContent','publishContent');
  ALTER table sunbird.role_group add url_action_ids list<text>;
- 
+
  update sunbird.role_group set url_action_ids=['addMember','removeMember','suspendMember'] where id='MEMBERSHIP_MANAGEMENT';
  update sunbird.role_group set url_action_ids=['createCourse','updateCourse','createContent','updateContent'] where id='CONTENT_CREATION';
  update sunbird.role_group set url_action_ids=['suspendOrg','suspendUser'] where id='SYSTEM_ADMINISTRATION';
@@ -329,7 +329,7 @@ ALTER TABLE sunbird.organisation ADD externalId text;
 ALTER TABLE sunbird.user_org drop role;
 ALTER TABLE sunbird.user_org ADD roles list<text>;
 
-//to export data from csv to cassandra table run below command(for page_section and page_management table) 
+//to export data from csv to cassandra table run below command(for page_section and page_management table)
 // change the path of csv file
 //COPY sunbird.page_management(id, appmap,createdby ,createddate ,name ,organisationid ,portalmap ,updatedby ,updateddate ) FROM '/tmp/cql/pageMgmt.csv';
 
@@ -351,11 +351,11 @@ ALTER TABLE sunbird.user ADD isDeleted boolean;
 
 //added for course batch
 CREATE TABLE IF NOT EXISTS sunbird.course_batch(id text, courseId text,courseCreator text,createdBy text,createdOn text,enrollmentType text,startDate text,endDate text,name text,description text,status int,lastUpdatedOn text,mentors List<text>,participants List<text>,createdFor List<text>,PRIMARY KEY (id));
-CREATE INDEX inx_cou_bat_status ON sunbird.course_batch (status); 
-CREATE INDEX inx_cou_bat_courseId ON sunbird.course_batch (courseId);     
-CREATE INDEX inx_cou_bat_courseCreator ON sunbird.course_batch (courseCreator); 
-CREATE INDEX inx_cou_bat_createdBy ON sunbird.course_batch (createdBy); 
-CREATE INDEX inx_cou_bat_enrolmentType ON sunbird.course_batch (enrollmentType); 
+CREATE INDEX inx_cou_bat_status ON sunbird.course_batch (status);
+CREATE INDEX inx_cou_bat_courseId ON sunbird.course_batch (courseId);
+CREATE INDEX inx_cou_bat_courseCreator ON sunbird.course_batch (courseCreator);
+CREATE INDEX inx_cou_bat_createdBy ON sunbird.course_batch (createdBy);
+CREATE INDEX inx_cou_bat_enrolmentType ON sunbird.course_batch (enrollmentType);
 ALTER TABLE sunbird.course_batch DROP createdon;
 ALTER TABLE sunbird.course_batch ADD createdDate text;
 ALTER TABLE sunbird.course_batch DROP lastupdatedon;
@@ -458,8 +458,8 @@ ALTER TABLE sunbird.org_type ADD createdBy text;
 ALTER TABLE sunbird.org_type ADD updatedDate text;
 ALTER TABLE sunbird.org_type ADD updatedBy text;
 //Adding table user_notes --Sep 13th 2017
-CREATE TABLE IF NOT EXISTS sunbird.user_notes(id text, userId text, courseId text, 
-contentId text, title text, note text, tags list<text>, createdDate text, createdBy text, 
+CREATE TABLE IF NOT EXISTS sunbird.user_notes(id text, userId text, courseId text,
+contentId text, title text, note text, tags list<text>, createdDate text, createdBy text,
 updatedDate text, updatedBy text, isDeleted boolean, PRIMARY KEY (id));
 CREATE INDEX inx_un_userId ON sunbird.user_notes(userId);
 CREATE INDEX inx_un_courseId ON sunbird.user_notes(courseId);
@@ -501,8 +501,8 @@ CREATE TABLE IF NOT EXISTS sunbird.skills(id text,skills list<text>, PRIMARY KEY
 //25th Oct
 ALTER TABLE sunbird.organisation ADD orgTypeId text;
 
-//Announcement apis -27th Oct 
-{% if groups['cassandra-2'] is defined %}
+//Announcement apis -27th Oct
+{% if (cassandra_cluster_size | int) > 1 %}
 CREATE KEYSPACE IF NOT EXISTS sunbirdplugin WITH REPLICATION = { 'class' : 'NetworkTopologyStrategy', 'datacenter1' : 2 };
 {% else %}
 CREATE KEYSPACE IF NOT EXISTS sunbirdplugin WITH REPLICATION = {'class':'SimpleStrategy','replication_factor':1};
@@ -517,10 +517,10 @@ CREATE TABLE sunbirdplugin.announcementauth (id text,userid text,rootorgid text,
 insert into sunbird.role_group (id,name) values ('ANNOUNCEMENT_SENDER','Announcement Sender');
 update sunbird.role_group set url_action_ids=['Announcement Sender'] where id='ANNOUNCEMENT_SENDER';
 insert into sunbird.role (id,name,rolegroupid,status) values ('ANNOUNCEMENT_SENDER','Announcement Sender',['ANNOUNCEMENT_SENDER'],1);
- 
+
 //mongodb import , env var is taken from group_vars
-//COPY sunbird.user_notes(id, userid,courseid,contentid,title,note,tags,createddate,updateddate,isdeleted) FROM '/tmp/notes-{{env}}.csv'; 
-//2nd Nov 
+//COPY sunbird.user_notes(id, userid,courseid,contentid,title,note,tags,createddate,updateddate,isdeleted) FROM '/tmp/notes-{{env}}.csv';
+//2nd Nov
 CREATE TABLE IF NOT EXISTS sunbird.tenant_preference(id text,tenantName text,orgId text,role text, data text, PRIMARY KEY (id));
 CREATE INDEX inx_tp_userId ON sunbird.tenant_preference(orgId);
 ALTER TABLE sunbird.user ADD tcstatus text;
diff --git a/ansible/roles/cassandra-cql-update/templates/content_service.cql b/ansible/roles/cassandra-cql-update/templates/content_service.cql
index 0113a69ee23b56fbfe6bae881dffa8646fa3fd97..fc3a70f0a30acd4ccab7f6bf4261db2547b46a1f 100644
--- a/ansible/roles/cassandra-cql-update/templates/content_service.cql
+++ b/ansible/roles/cassandra-cql-update/templates/content_service.cql
@@ -1,4 +1,4 @@
-{% if groups['cassandra-2'] is defined %}
+{% if (cassandra_cluster_size | int) > 1 %}
 CREATE KEYSPACE portal
 WITH REPLICATION = { 'class' : 'NetworkTopologyStrategy', 'datacenter1' : 2 };
 USE portal;
diff --git a/ansible/roles/cassandra/tasks/main.yml b/ansible/roles/cassandra/tasks/main.yml
index 34a0527be29921523b3783e79bf1caf424b3e8a8..8fb603ad168c58cfa159e4ed91f088fc41507435 100755
--- a/ansible/roles/cassandra/tasks/main.yml
+++ b/ansible/roles/cassandra/tasks/main.yml
@@ -12,7 +12,7 @@
 - name: add entry in hosts file
   become: yes
   lineinfile:
-    line: "127.0.0.1 {{hostnameOfCql.stdout}}"   
+    line: "127.0.0.1 {{hostnameOfCql.stdout}}"
     path: /etc/hosts
 
 - name: debian | Adding Cassandra Debian Repo Key
@@ -37,7 +37,7 @@
     owner: "root"
     group: "root"
     mode: "0644"
-  when: groups['cassandra-2'] is defined
+  when: ( cassandra_cluster_size | int ) > 1
 
 - name: copying the customized logback file
   template:
@@ -61,8 +61,8 @@
     seconds: 10
 
 - name: Restart Cassandra now
-  service: 
-    name: cassandra 
+  service:
+    name: cassandra
     state: restarted
 
 - name: wait for cassandra to be up and running
diff --git a/ansible/roles/cassandra/templates/cassandra-rackdc.properties.j2 b/ansible/roles/cassandra/templates/cassandra-rackdc.properties.j2
index b0c72aed4f13d71bac333cd743132fdc1ba88d1e..40241e3a45437275a14df2dcddaa9e1511f75789 100644
--- a/ansible/roles/cassandra/templates/cassandra-rackdc.properties.j2
+++ b/ansible/roles/cassandra/templates/cassandra-rackdc.properties.j2
@@ -16,7 +16,7 @@
 
 # These properties are used with GossipingPropertyFileSnitch and will
 # indicate the rack and dc for this node
-{% if groups['cassandra-2'] is defined %}
+{% if (cassandra_cluster_size | int) > 1 %}
 dc=datacenter1
 rack=rack1
 {% else %}
diff --git a/ansible/roles/cassandra/templates/cassandra.yaml.j2 b/ansible/roles/cassandra/templates/cassandra.yaml.j2
index adb2d867e31b6249b8361448fe46b3880a894843..e289ea7f9989f181b1feed4a4a61b39a2df38890 100755
--- a/ansible/roles/cassandra/templates/cassandra.yaml.j2
+++ b/ansible/roles/cassandra/templates/cassandra.yaml.j2
@@ -40,7 +40,7 @@ seed_provider:
       parameters:
           # seeds is actually a comma-delimited list of addresses.
           # Ex: "<ip1>,<ip2>,<ip3>"
-{% if groups['cassandra-2'] is defined %}
+{% if (cassandra_cluster_size | int) > 1 %}
           - seeds: "{{groups['cassandra'][0]}},{{groups['cassandra'][1]}}"
 {% else %}
           - seeds: {{cassandra_seeds}}
@@ -56,7 +56,7 @@ trickle_fsync: false
 trickle_fsync_interval_in_kb: 10240
 storage_port: 7000
 ssl_storage_port: 7001
-{% if groups['cassandra-2'] is defined %}
+{% if (cassandra_cluster_size | int) > 1 %}
 listen_address: {{hostvars[inventory_hostname]['ansible_default_ipv4']['address']}}
 broadcast_address: {{hostvars[inventory_hostname]['ansible_default_ipv4']['address']}}
 broadcast_rpc_address: {{hostvars[inventory_hostname]['ansible_default_ipv4']['address']}}
@@ -89,7 +89,7 @@ cas_contention_timeout_in_ms: 1000
 truncate_request_timeout_in_ms: 60000
 request_timeout_in_ms: 10000
 cross_node_timeout: false
-{% if groups['cassandra-2'] is defined %}
+{% if (cassandra_cluster_size | int) > 1 %}
 endpoint_snitch: GossipingPropertyFileSnitch
 {% else %}
 endpoint_snitch: SimpleSnitch
diff --git a/ansible/roles/stack-sunbird/templates/sunbird_cert-registry-service.env b/ansible/roles/stack-sunbird/templates/sunbird_cert-registry-service.env
index cba2fdd44a3502e6909c2be424cd6f1fc2cde23d..e28a121811ee657a87d3468dc1bc37470d4b4754 100644
--- a/ansible/roles/stack-sunbird/templates/sunbird_cert-registry-service.env
+++ b/ansible/roles/stack-sunbird/templates/sunbird_cert-registry-service.env
@@ -5,7 +5,7 @@ sunbird_cassandra_keyspace={{sunbird_cassandra_keyspace|d('sunbird')}}
 sunbird_cassandra_username={{sunbird_cassandra_username|d('cassandra')}}
 sunbird_cassandra_password={{sunbird_cassandra_password|d('password')}}
 sunbird_cassandra_consistency_level=quorum
-{% if groups['cassandra-2'] is defined %}
+{% if (cassandra_cluster_size | int) > 1 %}
 sunbird_cassandra_host={{groups['cassandra']|join(',')}}
 sunbird_cassandra_port=9042
 {% else %}
diff --git a/ansible/roles/stack-sunbird/templates/sunbird_groups-service.env b/ansible/roles/stack-sunbird/templates/sunbird_groups-service.env
index 32438e5432654f82d15bd12fb6a743f8abfe2f75..1ca289ef4a1625d931f153a00e3bbf699a0f7175 100644
--- a/ansible/roles/stack-sunbird/templates/sunbird_groups-service.env
+++ b/ansible/roles/stack-sunbird/templates/sunbird_groups-service.env
@@ -1,4 +1,4 @@
-{% if groups['cassandra-2'] is defined %}
+{% if (cassandra_cluster_size | int) > 1 %}
 sunbird_cassandra_host={{groups['cassandra']|join(',')}}
 sunbird_cassandra_port=9042,9042,9042
 sunbird_cassandra_consistency_level=quorum
@@ -33,4 +33,3 @@ max_group_limit={{max_group_limit | default(50)}}
 enable_userid_redis_cache={{enable_userid_redis_cache | default(true)}}
 groups_redis_ttl={{groups_redis_ttl | default(86400)}}
 user_redis_ttl={{user_redis_ttl | default(3600)}}
-
diff --git a/ansible/roles/stack-sunbird/templates/sunbird_knowledge-mw-service.env b/ansible/roles/stack-sunbird/templates/sunbird_knowledge-mw-service.env
index 90bff653b75c0218052a0cbfbe9c293d7ee21f23..6a13ddadfd990eaeae1660e575426200d8df5c78 100644
--- a/ansible/roles/stack-sunbird/templates/sunbird_knowledge-mw-service.env
+++ b/ansible/roles/stack-sunbird/templates/sunbird_knowledge-mw-service.env
@@ -47,7 +47,7 @@ sunbird_qrimage_topic={{sunbird_qrimage_topic}}
 sunbird_lock_expiry_time={{sunbird_lock_expiry_time}}
 # Release-1.14
 sunbird_content_service_log_level={{sunbird_content_service_log_level}}
-{% if groups['cassandra-2'] is defined %}
+{% if (cassandra_cluster_size | int) > 1 %}
 sunbird_cassandra_replication_strategy={{sunbird_cassandra_replication_strategy}}
 sunbird_cassandra_consistency_level=quorum
 {% else %}
diff --git a/ansible/roles/stack-sunbird/templates/sunbird_learner-service.env b/ansible/roles/stack-sunbird/templates/sunbird_learner-service.env
index b4af1d62a14b7a6f8e6d9dd8c641982eebe4fe54..dda04020c9a2d7a976a04e0d43739968fad4756e 100644
--- a/ansible/roles/stack-sunbird/templates/sunbird_learner-service.env
+++ b/ansible/roles/stack-sunbird/templates/sunbird_learner-service.env
@@ -37,7 +37,7 @@ sunbird_fcm_account_key={{sunbird_fcm_account_key}}
 sunbird_msg_91_auth={{sunbird_msg_91_auth}}
 sunbird_msg_sender={{sunbird_msg_sender}}
 sunbird_installation_email={{sunbird_installation_email}}
-{% if groups['cassandra-2'] is defined %}
+{% if (cassandra_cluster_size | int) > 1 %}
 sunbird_cassandra_host={{groups['cassandra']|join(',')}}
 sunbird_cassandra_port=9042,9042,9042
 sunbird_cassandra_consistency_level=quorum
@@ -127,4 +127,3 @@ form_api_endpoint={{form_api_endpoint | default('/plugin/v1/form/read')}}
 
 # Release-3.7.0
 learner_in_memory_cache_ttl={{learner_in_memory_cache_ttl | default(600)}}
-
diff --git a/ansible/roles/stack-sunbird/templates/sunbird_lms-service.env b/ansible/roles/stack-sunbird/templates/sunbird_lms-service.env
index f03b395f37b7bba87a075abc70de96f183801b61..728b81234d5c52a994d4c037bb6764dd9d92c97a 100644
--- a/ansible/roles/stack-sunbird/templates/sunbird_lms-service.env
+++ b/ansible/roles/stack-sunbird/templates/sunbird_lms-service.env
@@ -37,7 +37,7 @@ sunbird_fcm_account_key={{sunbird_fcm_account_key}}
 sunbird_msg_91_auth={{sunbird_msg_91_auth}}
 sunbird_msg_sender={{sunbird_msg_sender}}
 sunbird_installation_email={{sunbird_installation_email}}
-{% if groups['cassandra-2'] is defined %}
+{% if (cassandra_cluster_size | int) > 1 %}
 sunbird_cassandra_host={{groups['cassandra']|join(',')}}
 sunbird_cassandra_port=9042,9042,9042
 sunbird_cassandra_consistency_level=quorum
diff --git a/ansible/roles/stack-sunbird/templates/sunbird_player.env b/ansible/roles/stack-sunbird/templates/sunbird_player.env
index 87bbd8a729ddc6866dd6a330bfd5d49c5969ccfd..2be622e059ea43ed9673aec171e37e9b7b7d21e4 100644
--- a/ansible/roles/stack-sunbird/templates/sunbird_player.env
+++ b/ansible/roles/stack-sunbird/templates/sunbird_player.env
@@ -15,7 +15,7 @@ sunbird_api_auth_token={{sunbird_api_auth_token}}
 sunbird_enable_permission_check=1
 sunbird_cassandra_urls={{sunbird_cassandra_urls}}
 sunbird_session_store_type={{sunbird_session_store_type}}
-AZURE_STORAGE_ACCOUNT={{sunbird_public_storage_account_name}} 
+AZURE_STORAGE_ACCOUNT={{sunbird_public_storage_account_name}}
 AZURE_STORAGE_KEY={{sunbird_public_storage_account_key}}
 sunbird_dataservice_url={{sunbird_dataservice_url}}
 sunbird_telemetry_packet_size={{sunbird_telemetry_packet_size}}
@@ -48,7 +48,7 @@ sunbird_azure_account_key={{sunbird_private_storage_account_key}}
 sunbird_response_cache_ttl={{sunbird_response_cache_ttl}}
 sunbird_portal_preview_cdn_url={{sunbird_portal_preview_cdn_url}}
 
-{% if groups['cassandra-2'] is defined %}
+{% if (cassandra_cluster_size | int) > 1 %}
 sunbird_cassandra_replication_strategy={{sunbird_cassandra_replication_strategy}}
 sunbird_cassandra_consistency_level=quorum
 {% else %}