From 88f5d4ebb0ed7ea9ef341888cb53016fe2775383 Mon Sep 17 00:00:00 2001 From: Erick Cardona Date: Wed, 21 Dec 2016 11:44:20 -0600 Subject: Fix cluster reset Prevent to stop_app in the rabbitmq_master as it cannot be reset if it is stopped. Also, when joining a cluster, the nodes must use the short-hostname form of the master FQDN. Signed-off-by: Erick Cardona --- tasks/rabbitmq_clustering.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tasks/rabbitmq_clustering.yml') diff --git a/tasks/rabbitmq_clustering.yml b/tasks/rabbitmq_clustering.yml index 9dece46..5134c50 100644 --- a/tasks/rabbitmq_clustering.yml +++ b/tasks/rabbitmq_clustering.yml @@ -1,9 +1,11 @@ --- - name: rabbitmq_clustering | stopping rabbitmq app command: rabbitmqctl stop_app + when: inventory_hostname != "{{ rabbitmq_master }}" - name: rabbitmq_clustering | resetting rabbitmq app command: rabbitmqctl reset + when: inventory_hostname != "{{ rabbitmq_master }}" - name: rabbitmq_clustering | stopping rabbitmq-server service: @@ -55,7 +57,7 @@ when: inventory_hostname != "{{ rabbitmq_master }}" - name: rabbitmq_clustering | joining rabbitmq cluster - command: rabbitmqctl join_cluster 'rabbit@{{ rabbitmq_master }}' + command: rabbitmqctl join_cluster "rabbit@{{ hostvars[rabbitmq_master]['ansible_hostname'] }}" register: cluster_joined when: inventory_hostname != "{{ rabbitmq_master }}" -- cgit v1.2.3