aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorErick Cardona <erick.cardona.ruiz@intel.com>2016-12-21 11:44:20 -0600
committerErick Cardona <erick.cardona.ruiz@intel.com>2016-12-21 16:56:06 -0600
commit88f5d4ebb0ed7ea9ef341888cb53016fe2775383 (patch)
treef681429747f8afabb654945f12d4224dea623bad
parent109c6b750751d1c5cd216ad2f09258cf512c4c9e (diff)
downloadansible-rabbitmq-88f5d4ebb0ed7ea9ef341888cb53016fe2775383.tar.gz
ansible-rabbitmq-88f5d4ebb0ed7ea9ef341888cb53016fe2775383.tar.zst
ansible-rabbitmq-88f5d4ebb0ed7ea9ef341888cb53016fe2775383.zip
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 <erick.cardona.ruiz@intel.com>
-rw-r--r--tasks/rabbitmq_clustering.yml4
1 files changed, 3 insertions, 1 deletions
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 @@
1--- 1---
2- name: rabbitmq_clustering | stopping rabbitmq app 2- name: rabbitmq_clustering | stopping rabbitmq app
3 command: rabbitmqctl stop_app 3 command: rabbitmqctl stop_app
4 when: inventory_hostname != "{{ rabbitmq_master }}"
4 5
5- name: rabbitmq_clustering | resetting rabbitmq app 6- name: rabbitmq_clustering | resetting rabbitmq app
6 command: rabbitmqctl reset 7 command: rabbitmqctl reset
8 when: inventory_hostname != "{{ rabbitmq_master }}"
7 9
8- name: rabbitmq_clustering | stopping rabbitmq-server 10- name: rabbitmq_clustering | stopping rabbitmq-server
9 service: 11 service:
@@ -55,7 +57,7 @@
55 when: inventory_hostname != "{{ rabbitmq_master }}" 57 when: inventory_hostname != "{{ rabbitmq_master }}"
56 58
57- name: rabbitmq_clustering | joining rabbitmq cluster 59- name: rabbitmq_clustering | joining rabbitmq cluster
58 command: rabbitmqctl join_cluster 'rabbit@{{ rabbitmq_master }}' 60 command: rabbitmqctl join_cluster "rabbit@{{ hostvars[rabbitmq_master]['ansible_hostname'] }}"
59 register: cluster_joined 61 register: cluster_joined
60 when: inventory_hostname != "{{ rabbitmq_master }}" 62 when: inventory_hostname != "{{ rabbitmq_master }}"
61 63