Skip to content

Commit 815b9e5

Browse files
authored
Merge pull request #7 from hellofresh/fix/ansible-2.3
Ansible 2.3 compatibility fix
2 parents b2cbd5b + 59de07f commit 815b9e5

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

tasks/cluster/cluster.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,23 @@
77
when: rabbitmq_cluster_instance_to_join != ansible_fqdn
88
register: cluster_result
99

10+
- name: debug
11+
debug:
12+
var: cluster_result
13+
1014
- name: cluster | stop rabbitmq app for standalone nodes in order to join
1115
shell: "rabbitmqctl stop_app"
12-
when: cluster_result is defined and cluster_result.rc == 1
16+
when: cluster_result is defined and cluster_result.rc is defined and cluster_result.rc == 1
1317

1418
# for this to work, an entry including the short hostname must exist in /etc/hosts
1519
- name: cluster | add this node to cluster
1620
shell: "rabbitmqctl join_cluster rabbit@{{ rabbitmq_cluster_instance_to_join }}"
17-
when: cluster_result is defined and cluster_result.rc == 1
21+
when: cluster_result is defined and cluster_result.rc is defined and cluster_result.rc == 1
1822

1923
# TODO: consider adding functionality to join multiple nodes if one of the nodes is down
2024
- name: cluster | start rabbitmq app for standalone nodes
2125
shell: "rabbitmqctl start_app"
22-
when: cluster_result is defined and cluster_result.rc == 1
26+
when: cluster_result is defined and cluster_result.rc is defined and cluster_result.rc == 1
2327

2428
- name: cluster | get nodes from API
2529
uri:

0 commit comments

Comments
 (0)