From 63e3f4dea9331d145763221f94486e0a467cd662 Mon Sep 17 00:00:00 2001 From: Zhong Jianxin Date: Tue, 27 Sep 2022 15:07:51 +0800 Subject: [PATCH] [2.19] preinstall: Add nodelocaldns to supersede_nameserver if enabled (#9324) When a machine that use dhclient and resolvconf reboots, this will make /etc/resolv.conf remain close to the one before reboot --- roles/kubernetes/preinstall/tasks/0040-set_facts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/kubernetes/preinstall/tasks/0040-set_facts.yml b/roles/kubernetes/preinstall/tasks/0040-set_facts.yml index 6c5ba4b89..fadf2f377 100644 --- a/roles/kubernetes/preinstall/tasks/0040-set_facts.yml +++ b/roles/kubernetes/preinstall/tasks/0040-set_facts.yml @@ -190,7 +190,7 @@ nameserverentries: |- {{ ( ( [nodelocaldns_ip] if enable_nodelocaldns else []) + coredns_server|d([]) + nameservers|d([]) + cloud_resolver|d([]) + configured_nameservers|d([])) | unique | join(',') }} supersede_nameserver: - supersede domain-name-servers {{ ( coredns_server|d([]) + nameservers|d([]) + cloud_resolver|d([])) | unique | join(', ') }}; + supersede domain-name-servers {{ ( ( [nodelocaldns_ip] if enable_nodelocaldns else []) + coredns_server|d([]) + nameservers|d([]) + cloud_resolver|d([])) | unique | join(', ') }}; when: not dns_early or dns_late # This task should run instead of the above task when cluster/nodelocal DNS hasn't