From 9365dbe4040c87c2b2c257ea9a4e27a22e312083 Mon Sep 17 00:00:00 2001 From: grahamneville Date: Wed, 13 Nov 2019 19:00:54 +0000 Subject: [PATCH] Force_boot rabbit if mnesia exists --- .../kubernetes/templates/deployment.yml.j2 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/installer/roles/kubernetes/templates/deployment.yml.j2 b/installer/roles/kubernetes/templates/deployment.yml.j2 index c45e5eb7351d..adb0e7fe2d48 100644 --- a/installer/roles/kubernetes/templates/deployment.yml.j2 +++ b/installer/roles/kubernetes/templates/deployment.yml.j2 @@ -208,6 +208,23 @@ spec: - name: {{ kubernetes_deployment_name }}-rabbit image: "{{ kubernetes_rabbitmq_image }}:{{ kubernetes_rabbitmq_version }}" imagePullPolicy: Always + command: + - bash + - -ec + - | + [[ -n "$DEBUG" ]] && set -x + set -e + + if [ `id -u` -ge 500 ]; then + echo "rabbitmq:x:`id -u`:`id -g`:,,,:${HOME}:/bin/ash" >> /tmp/passwd + cat /tmp/passwd > /etc/passwd + rm /tmp/passwd + fi + + echo "$RABBITMQ_ERLANG_COOKIE" > $HOME/.erlang.cookie + chmod 0600 $HOME/.erlang.cookie + if [ -d "/var/lib/rabbitmq/mnesia/${RABBITMQ_NODENAME}" ]; then rabbitmqctl force_boot; fi + exec rabbitmq-server ports: - name: http protocol: TCP