aboutsummaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/mq/tasks/rabbitmq_cluster.yml
blob: cb83a0c904ff3feb38ce68fe5d457309050d96b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
---
- name: stop rabbitmq app
  command: rabbitmqctl stop_app
  when: HA_CLUSTER[inventory_hostname] != ''

- name: rabbitmqctl reset
  command: rabbitmqctl reset
  when: HA_CLUSTER[inventory_hostname] != ''

- name: stop  rabbitmq
  shell:  rabbitmqctl stop

- name: set detach
  shell: rabbitmq-server -detached

- name: join  cluster
  command: rabbitmqctl join_cluster rabbit@{{ item }}
  when: item  != inventory_hostname and HA_CLUSTER[item] == ''
  with_items:
    groups['controller']

- name: start rabbitmq app
  command: rabbitmqctl start_app

- name: set the HA policy
  rabbitmq_policy: name=ha-all pattern='^(?!amq\.).*' tags="ha-mode=all"