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 }}