Skip to content

Commit

Permalink
Merge pull request #7 from hellofresh/fix/ansible-2.3
Browse files Browse the repository at this point in the history
Ansible 2.3 compatibility fix
  • Loading branch information
zeelax authored Dec 6, 2017
2 parents b2cbd5b + 59de07f commit 815b9e5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tasks/cluster/cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,23 @@
when: rabbitmq_cluster_instance_to_join != ansible_fqdn
register: cluster_result

- name: debug
debug:
var: cluster_result

- name: cluster | stop rabbitmq app for standalone nodes in order to join
shell: "rabbitmqctl stop_app"
when: cluster_result is defined and cluster_result.rc == 1
when: cluster_result is defined and cluster_result.rc is defined and cluster_result.rc == 1

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

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

- name: cluster | get nodes from API
uri:
Expand Down

0 comments on commit 815b9e5

Please sign in to comment.