diff --git a/roles/kubernetes/secrets/templates/openssl.conf.j2 b/roles/kubernetes/secrets/templates/openssl.conf.j2 index 579e2aad1..d9720c3fe 100644 --- a/roles/kubernetes/secrets/templates/openssl.conf.j2 +++ b/roles/kubernetes/secrets/templates/openssl.conf.j2 @@ -36,7 +36,7 @@ IP.{{ counter["ip"] }} = {{ hostvars[host]['ip'] | default(hostvars[host]['ansib {% if kube_apiserver_ip is defined %} IP.{{ counter["ip"] }} = {{ kube_apiserver_ip }}{{ increment(counter, 'ip') }} {% endif %} -{% if loadbalancer_apiserver.address is defined %} +{% if loadbalancer_apiserver is defined and loadbalancer_apiserver.address is defined %} IP.{{ counter["ip"] }} = {{ loadbalancer_apiserver.address }}{{ increment(counter, 'ip') }} {% endif %} {% if supplementary_addresses_in_ssl_keys is defined %}