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