From 5ae782ff52a2604fb1f392d77a018896f29dae49 Mon Sep 17 00:00:00 2001 From: Ruslan Khanbikov Date: Wed, 4 Jul 2018 20:47:01 -0700 Subject: [PATCH] Helm-Toolkit: adds import additional rabbitmq configuration It adds an ability to specify the auxiliary configuraiton for rabbitmq like policies, permissions loading json formatted data Change-Id: I85240a50fb64a4d74454768034fe3bdcf25f3019 Signed-off-by: Ruslan Khanbikov --- .../templates/manifests/_job-rabbit-init.yaml.tpl | 4 ++++ helm-toolkit/templates/scripts/_rabbit-init.sh.tpl | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/helm-toolkit/templates/manifests/_job-rabbit-init.yaml.tpl b/helm-toolkit/templates/manifests/_job-rabbit-init.yaml.tpl index 53365289a..9224458b4 100644 --- a/helm-toolkit/templates/manifests/_job-rabbit-init.yaml.tpl +++ b/helm-toolkit/templates/manifests/_job-rabbit-init.yaml.tpl @@ -64,6 +64,10 @@ spec: secretKeyRef: name: {{ index $envAll.Values.secrets.oslo_messaging $serviceName }} key: RABBITMQ_CONNECTION +{{- if $envAll.Values.conf.rabbitmq }} + - name: RABBITMQ_AUXILIARY_CONFIGURATION + value: {{ toJson $envAll.Values.conf.rabbitmq | quote }} +{{- end }} volumes: - name: rabbit-init-sh configMap: diff --git a/helm-toolkit/templates/scripts/_rabbit-init.sh.tpl b/helm-toolkit/templates/scripts/_rabbit-init.sh.tpl index e54442df7..84d58593c 100644 --- a/helm-toolkit/templates/scripts/_rabbit-init.sh.tpl +++ b/helm-toolkit/templates/scripts/_rabbit-init.sh.tpl @@ -75,4 +75,12 @@ rabbitmqadmin_cli \ configure=".*" \ write=".*" \ read=".*" + +if [ ! -z "$RABBITMQ_AUXILIARY_CONFIGURATION" ] +then + echo "Applying additional configuration" + echo "${RABBITMQ_AUXILIARY_CONFIGURATION}" > /tmp/rmq_definitions.json + rabbitmqadmin_cli import /tmp/rmq_definitions.json +fi + {{- end }}