From 34c2e48e0adf1273e78e685f90cd6c21fc780d3e Mon Sep 17 00:00:00 2001 From: Hao Liu Date: Fri, 3 Nov 2023 11:13:12 -0400 Subject: [PATCH] Fix bug where external_ipaddress is required external_ipaddress is optional and we should be able to deal with missing external_ipaddress with no error --- .../mesh_ingress/templates/deployment.yml.j2 | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/roles/mesh_ingress/templates/deployment.yml.j2 b/roles/mesh_ingress/templates/deployment.yml.j2 index e98c4ff7..90bbe646 100644 --- a/roles/mesh_ingress/templates/deployment.yml.j2 +++ b/roles/mesh_ingress/templates/deployment.yml.j2 @@ -18,10 +18,30 @@ spec: - -c - | internal_hostname={{ ansible_operator_meta.name }} +{% if external_hostname is defined %} external_hostname={{ external_hostname }} +{% endif %} +{% if external_ipaddress is defined %} external_ipaddress={{ external_ipaddress }} - receptor --cert-makereq bits=2048 commonname=$internal_hostname dnsname=$internal_hostname dnsname=$external_hostname nodeid=$internal_hostname ipaddress=$external_ipaddress outreq=/etc/receptor/tls/receptor.req outkey=/etc/receptor/tls/receptor.key - receptor --cert-signreq req=/etc/receptor/tls/receptor.req cacert=/etc/receptor/tls/ca/mesh-CA.crt cakey=/etc/receptor/tls/ca/mesh-CA.key outcert=/etc/receptor/tls/receptor.crt verify=yes +{% endif %} + receptor --cert-makereq bits=2048 \ + commonname=$internal_hostname \ + dnsname=$internal_hostname \ + nodeid=$internal_hostname \ +{% if external_hostname is defined %} + dnsname=$external_hostname \ +{% endif %} +{% if external_ipaddress is defined %} + ipaddress=$external_ipaddress \ +{% endif %} + outreq=/etc/receptor/tls/receptor.req \ + outkey=/etc/receptor/tls/receptor.key + receptor --cert-signreq \ + req=/etc/receptor/tls/receptor.req \ + cacert=/etc/receptor/tls/ca/mesh-CA.crt \ + cakey=/etc/receptor/tls/ca/mesh-CA.key \ + outcert=/etc/receptor/tls/receptor.crt \ + verify=yes exec receptor --config /etc/receptor/receptor.conf image: '{{ _control_plane_ee_image }}' imagePullPolicy: '{{ _image_pull_policy }}'