From af1b69cb1e7f456e19b391802097fe8d59a4ff1c Mon Sep 17 00:00:00 2001 From: Steve Lewis Date: Wed, 27 May 2015 18:39:48 -0700 Subject: [PATCH] Set Rabbit recovery method for network partitions Adds configurable option rabbit_cluster_partition_handling with default value of pause_minority. Allows option to be explicitly set to ignore through Ansible to reset to prior (and RabbitMQ default) behavior. Change-Id: I52625390b388a55c6ed210b5804c7de336985f37 Closes-Bug: #1454860 --- playbooks/roles/rabbitmq_server/defaults/main.yml | 3 +++ playbooks/roles/rabbitmq_server/templates/rabbitmq.config.j2 | 1 + 2 files changed, 4 insertions(+) diff --git a/playbooks/roles/rabbitmq_server/defaults/main.yml b/playbooks/roles/rabbitmq_server/defaults/main.yml index c7566e386d..e0484720c3 100644 --- a/playbooks/roles/rabbitmq_server/defaults/main.yml +++ b/playbooks/roles/rabbitmq_server/defaults/main.yml @@ -34,6 +34,9 @@ rabbitmq_userid: rabbitmq # Name of the rabbitmq cluster rabbitmq_cluster_name: rabbitmq_cluster1 +# Specify a partition recovery strategy (autoheal | pause_minority | ignore) +rabbitmq_cluster_partition_handling: pause_minority + # Rabbitmq open file limits rabbitmq_ulimit: 4096 diff --git a/playbooks/roles/rabbitmq_server/templates/rabbitmq.config.j2 b/playbooks/roles/rabbitmq_server/templates/rabbitmq.config.j2 index 3a178d89a0..834c5af81f 100644 --- a/playbooks/roles/rabbitmq_server/templates/rabbitmq.config.j2 +++ b/playbooks/roles/rabbitmq_server/templates/rabbitmq.config.j2 @@ -1,6 +1,7 @@ [ {rabbit, [ {loopback_users, []}, + {% if rabbitmq_cluster_partition_handling != 'ignore' %}{cluster_partition_handling, {{ rabbitmq_cluster_partition_handling }}},{% endif %} {cluster_nodes, { [ {% for host in groups['rabbitmq_all'] %}'rabbit@{{ hostvars[host]['ansible_ssh_host'] }}'{% if not loop.last %}, {% endif %}{% endfor %}], disc} }