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
This commit is contained in:
Hao Liu
2023-11-03 11:13:12 -04:00
committed by Christian Adams
parent 122995fda7
commit 34c2e48e0a

View File

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