Fix deployment without openstack cacert (#7723)

* fix group name

* fix external-openstack-cloud-config secret

* don't add ca.cert in the secret if not defined
This commit is contained in:
Id2ndR 2021-06-21 14:38:50 +02:00 committed by GitHub
parent e83728897b
commit a31baf3c16
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View file

@ -7,7 +7,7 @@
src: "{{ external_openstack_cacert }}"
register: external_openstack_cacert_b64
when:
- inventory_hostname == groups['k8s_control_plane'][0]
- inventory_hostname == groups['kube_control_plane'][0]
- external_openstack_cacert is defined
- external_openstack_cacert | length > 0
tags: external-openstack

View file

@ -7,5 +7,7 @@ metadata:
name: external-openstack-cloud-config
namespace: kube-system
data:
cloud.conf: {{ external_openstack_cloud_config_secret.content }}
ca.cert: {{ external_openstack_cacert_b64.content | default("") }}
cloud.conf: {{ external_openstack_cloud_config_secret }}
{% if external_openstack_cacert_b64.content is defined %}
ca.cert: {{ external_openstack_cacert_b64.content }}
{% endif %}