From 4db5e663c32888d36e01b4ef510c9dd9111e6605 Mon Sep 17 00:00:00 2001
From: Kay Yan <yankay@users.noreply.github.com>
Date: Wed, 30 Nov 2022 19:48:56 +0800
Subject: [PATCH] fix-mistake-regex-for-resolv-conf (#9523)

---
 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 d9e010162..08deb1c86 100644
--- a/roles/kubernetes/preinstall/tasks/0040-set_facts.yml
+++ b/roles/kubernetes/preinstall/tasks/0040-set_facts.yml
@@ -70,7 +70,7 @@
 
     - name: get currently configured nameservers
       set_fact:
-        configured_nameservers: "{{ resolvconf_slurp.content | b64decode | regex_findall('\\s*nameserver\\s*(.*)') | ipaddr }}"
+        configured_nameservers: "{{ resolvconf_slurp.content | b64decode | regex_findall('^nameserver\\s*(.*)', multiline=True) | ipaddr }}"
       when: resolvconf_slurp.content is defined
 
   when: resolvconf_stat.stat.exists is defined and resolvconf_stat.stat.exists
-- 
GitLab