From 6ab9e12f16b7afa8277a1e673411b638feabb04c Mon Sep 17 00:00:00 2001 From: Shubham Gupta Date: Mon, 13 Feb 2023 23:01:40 +0530 Subject: [PATCH] add : Rebalance Cluster after node addition --- playbooks/add-redis-leader.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/playbooks/add-redis-leader.yml b/playbooks/add-redis-leader.yml index b54df64..8443c16 100644 --- a/playbooks/add-redis-leader.yml +++ b/playbooks/add-redis-leader.yml @@ -24,3 +24,10 @@ when: > inventory_hostname in groups['leader'][0] and new_leader_node not in command_result.stdout + +- name: Rebalance the Redis cluster + command: |- + {{redis_command}} + --cluster rebalance {{ansible_ssh_host}}:{{redis_port}} + when: >- + node_status == "ready" and inventory_hostname in groups['leader'][0] \ No newline at end of file