Skip to content

Commit

Permalink
Fix bug where external_ipaddress is required
Browse files Browse the repository at this point in the history
external_ipaddress is optional and we should be able to deal with missing external_ipaddress with no error
  • Loading branch information
TheRealHaoLiu committed Nov 3, 2023
1 parent 69b7072 commit 45a5c99
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions roles/mesh_ingress/templates/deployment.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}'
Expand Down

0 comments on commit 45a5c99

Please sign in to comment.