diff options
Diffstat (limited to 'deploy/adapters/ansible/roles/mq/tasks/rabbitmq_cluster.yml')
-rw-r--r-- | deploy/adapters/ansible/roles/mq/tasks/rabbitmq_cluster.yml | 30 |
1 files changed, 8 insertions, 22 deletions
diff --git a/deploy/adapters/ansible/roles/mq/tasks/rabbitmq_cluster.yml b/deploy/adapters/ansible/roles/mq/tasks/rabbitmq_cluster.yml index fdc18a65..0cae5298 100644 --- a/deploy/adapters/ansible/roles/mq/tasks/rabbitmq_cluster.yml +++ b/deploy/adapters/ansible/roles/mq/tasks/rabbitmq_cluster.yml @@ -1,27 +1,13 @@ --- - name: stop rabbitmq app - command: rabbitmqctl stop_app - run_once: True + shell: rabbitmqctl stop_app; sleep 3 -- name: rabbitmqctl reset - command: rabbitmqctl reset - run_once: True - -- 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: join cluster + shell: rabbitmqctl join_cluster rabbit@{{ haproxy_hosts.keys()[0] }} + register: join_result + until: join_result|success + retries: 20 + delay: 3 - name: start rabbitmq app - command: rabbitmqctl start_app - -- name: set the HA policy - rabbitmq_policy: name=ha-all pattern='^(?!amq\.).*' tags="ha-mode=all" - + shell: rabbitmqctl start_app |