diff --git a/roles/eda/templates/ca-mount-fragment.yaml.j2 b/roles/eda/templates/ca-mount-fragment.yaml.j2 new file mode 100644 index 00000000..7f3792d8 --- /dev/null +++ b/roles/eda/templates/ca-mount-fragment.yaml.j2 @@ -0,0 +1,8 @@ +{% if bundle_ca_crt %} +- name: "ca-trust-extracted" + mountPath: "/etc/pki/ca-trust/extracted" +- name: "{{ ansible_operator_meta.name }}-bundle-cacert" + mountPath: /etc/pki/ca-trust/source/anchors/bundle-ca.crt + subPath: bundle-ca.crt + readOnly: true +{% endif %} \ No newline at end of file diff --git a/roles/eda/templates/eda-api.deployment.yaml.j2 b/roles/eda/templates/eda-api.deployment.yaml.j2 index 74f5178a..3543a837 100644 --- a/roles/eda/templates/eda-api.deployment.yaml.j2 +++ b/roles/eda/templates/eda-api.deployment.yaml.j2 @@ -362,14 +362,7 @@ spec: - name: static-files mountPath: {{ static_path }} {% endif %} -{% if bundle_ca_crt %} - - name: "ca-trust-extracted" - mountPath: "/etc/pki/ca-trust/extracted" - - name: "{{ ansible_operator_meta.name }}-bundle-cacert" - mountPath: /etc/pki/ca-trust/source/anchors/bundle-ca.crt - subPath: bundle-ca.crt - readOnly: true -{% endif %} + {{lookup("template", "ca-mount-fragment.yaml.j2") | indent(width=8) | trim }} {% endif %} - name: daphne image: {{ _image }} @@ -422,12 +415,7 @@ spec: {% endif %} {% if bundle_ca_crt %} volumeMounts: - - name: "ca-trust-extracted" - mountPath: "/etc/pki/ca-trust/extracted" - - name: "{{ ansible_operator_meta.name }}-bundle-cacert" - mountPath: /etc/pki/ca-trust/source/anchors/bundle-ca.crt - subPath: bundle-ca.crt - readOnly: true + {{lookup("template", "ca-mount-fragment.yaml.j2") | indent(width=8) | trim }} {% endif %} - name: nginx image: {{ _image_web }}