Allow to configure cluster_status env variables
Due to internal bugs in rabbitmq restart procedure of one node
in cluster might lead to cluster non-operability.
When node is joingin to cluster the cluster should be in
well-established state. This patch allows to configure
cluster wait variables that are used by startup script and provide
such guarantee:
rabbitmq:
cluster:
cluster_status:
cluster_status_timeout: 1200
cluster_status_retry_delay: 10
Change-Id: If7d7dd75be25199366e52345a53e46ad749c4088
Related-Prod: PROD-29098
diff --git a/rabbitmq/files/rabbitmq-env.conf b/rabbitmq/files/rabbitmq-env.conf
index c4edc69..85ac17a 100644
--- a/rabbitmq/files/rabbitmq-env.conf
+++ b/rabbitmq/files/rabbitmq-env.conf
@@ -1,4 +1,4 @@
-{%- from "rabbitmq/map.jinja" import server with context %}
+{%- from "rabbitmq/map.jinja" import server,cluster with context %}
{%- if server.ssl.enabled %}
{%- include "rabbitmq/files/ssl/ssl_env.conf.j2" %}
{%- endif %}
@@ -11,3 +11,14 @@
{{ "%s=%s"|format(opt|upper, value) }}
{%- endif %}
{%- endfor %}
+{%- if cluster.get('enabled', False) %}
+{%- if cluster.get('cluster_status', {}).get('enabled', True) %}
+CLUSTER_MEMBERS="{% for node in cluster.members %}{{ node.name }}{% if not loop.last %};{% endif %}{% endfor %}"
+{%- if cluster.get('cluster_status', {}).cluster_status_timeout is defined %}
+CLUSTER_STATUS_TIMEOUT={{ cluster.cluster_status.cluster_status_timeout }}
+{%- endif %}
+{%- if cluster.get('cluster_status', {}).cluster_status_retry_delay is defined %}
+CLUSTER_STATUS_RETRY_DELAY={{ cluster.cluster_status.cluster_status_retry_delay }}
+{%- endif %}
+{%- endif %}
+{%- endif %}