From 841c61aaa167199622edbefeddeb241f546b1269 Mon Sep 17 00:00:00 2001 From: Florian Ruynat <16313165+floryut@users.noreply.github.com> Date: Mon, 3 Jan 2022 10:37:00 +0100 Subject: [PATCH] Revert "Fix external lb error (#8299)" (#8360) This reverts commit 4f2e4524b8f730bf40b62b249143380c457d7dc4. --- roles/kubernetes/preinstall/defaults/main.yml | 7 ------- roles/kubernetes/preinstall/tasks/0090-etchosts.yml | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/roles/kubernetes/preinstall/defaults/main.yml b/roles/kubernetes/preinstall/defaults/main.yml index f755adf6d..10f22cb5b 100644 --- a/roles/kubernetes/preinstall/defaults/main.yml +++ b/roles/kubernetes/preinstall/defaults/main.yml @@ -60,10 +60,3 @@ pkg_install_retries: 4 # Check if access_ip responds to ping. Set false if your firewall blocks ICMP. ping_access_ip: true - -apiserver_loadbalancer_domain_name_host: |- - {% if inventory_hostname in groups['kube_control_plane'] -%} - 127.0.0.1 - {%- else -%} - {{ loadbalancer_apiserver.address }} - {%- endif %} diff --git a/roles/kubernetes/preinstall/tasks/0090-etchosts.yml b/roles/kubernetes/preinstall/tasks/0090-etchosts.yml index 6357975f2..32a2c8e77 100644 --- a/roles/kubernetes/preinstall/tasks/0090-etchosts.yml +++ b/roles/kubernetes/preinstall/tasks/0090-etchosts.yml @@ -29,7 +29,7 @@ lineinfile: dest: /etc/hosts regexp: ".*{{ apiserver_loadbalancer_domain_name }}$" - line: "{{ apiserver_loadbalancer_domain_name_host }} {{ apiserver_loadbalancer_domain_name }}" + line: "{{ loadbalancer_apiserver.address }} {{ apiserver_loadbalancer_domain_name }}" state: present backup: yes unsafe_writes: yes