From 70d4f70c3cca7d2b32ee1d16ce55cb611a8756a9 Mon Sep 17 00:00:00 2001 From: Zhong Jianxin Date: Tue, 13 Sep 2022 15:27:03 +0800 Subject: [PATCH] [2.18] preinstall: Add nodelocaldns to supersede_nameserver if enabled 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 1cfd47777..44da31e08 100644 --- a/roles/kubernetes/preinstall/tasks/0040-set_facts.yml +++ b/roles/kubernetes/preinstall/tasks/0040-set_facts.yml @@ -182,7 +182,7 @@ nameserverentries: nameserver {{ ( ( [nodelocaldns_ip] if enable_nodelocaldns else []) + coredns_server|d([]) + nameservers|d([]) + cloud_resolver|d([]) + configured_nameservers|d([])) | unique | join(',nameserver ') }} 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(', ') }}; - name: gather os specific variables include_vars: "{{ item }}"