summaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
authorMateus Caruccio <mateus.caruccio@getupcloud.com>2017-09-13 14:49:56 -0300
committerScott Dodson <sdodson@redhat.com>2017-09-15 16:51:18 -0400
commitafb74ff054ff5743998e2611cab83960710920de (patch)
tree9e2e1bd1694593de5738f801156733ebe41a7c44 /roles
parent87449eed97d4a4320a08706f071192853961535f (diff)
downloadopenshift-afb74ff054ff5743998e2611cab83960710920de.tar.gz
openshift-afb74ff054ff5743998e2611cab83960710920de.tar.bz2
openshift-afb74ff054ff5743998e2611cab83960710920de.tar.xz
openshift-afb74ff054ff5743998e2611cab83960710920de.zip
Ensure valid search on resolv.conf
On cluster without internal name resolution there will be no `search XXX` on /etc/resolv.conf at all, thus this script will fail to add an entry for `cluster.local`.
Diffstat (limited to 'roles')
-rwxr-xr-xroles/openshift_node_dnsmasq/files/networkmanager/99-origin-dns.sh2
1 files changed, 2 insertions, 0 deletions
diff --git a/roles/openshift_node_dnsmasq/files/networkmanager/99-origin-dns.sh b/roles/openshift_node_dnsmasq/files/networkmanager/99-origin-dns.sh
index 61d2a5b51..df02bcf0e 100755
--- a/roles/openshift_node_dnsmasq/files/networkmanager/99-origin-dns.sh
+++ b/roles/openshift_node_dnsmasq/files/networkmanager/99-origin-dns.sh
@@ -114,6 +114,8 @@ EOF
echo "nameserver "${def_route_ip}"" >> ${NEW_RESOLV_CONF}
if ! grep -q 'search.*cluster.local' ${NEW_RESOLV_CONF}; then
sed -i '/^search/ s/$/ cluster.local/' ${NEW_RESOLV_CONF}
+ elif ! grep -qw search ${NEW_RESOLV_CONF}; then
+ echo 'search cluster.local' >> ${NEW_RESOLV_CONF}
fi
cp -Z ${NEW_RESOLV_CONF} /etc/resolv.conf
fi