summaryrefslogtreecommitdiffstats
path: root/roles/openshift_node_dnsmasq
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2017-10-10 07:59:24 -0700
committerGitHub <noreply@github.com>2017-10-10 07:59:24 -0700
commit48126155eade2d030398f69dc5ee32838ec08480 (patch)
tree0601f6b220cb4fe8e2d8e6959b49d18aafc1e351 /roles/openshift_node_dnsmasq
parentd3108f4f593a0cb75b206256df37c3f47aed4988 (diff)
parent7f20af939e13a7cec3cf56cedd7aa8a302ee58db (diff)
downloadopenshift-48126155eade2d030398f69dc5ee32838ec08480.tar.gz
openshift-48126155eade2d030398f69dc5ee32838ec08480.tar.bz2
openshift-48126155eade2d030398f69dc5ee32838ec08480.tar.xz
openshift-48126155eade2d030398f69dc5ee32838ec08480.zip
Merge pull request #5585 from nak3/bz#1496593
Automatic merge from submit-queue. Add valid search when search does not exist on resolv.conf Current fix https://github.com/openshift/openshift-ansible/pull/5433 still misses to add `search cluster.local`. The logic needs to be: 1. When `search` does not exist, adds `search cluster.local`. 2. When `search.*.cluster.local` does not exist, adds(sed) `cluster.local`. in this order. cc @sdodson @caruccio
Diffstat (limited to 'roles/openshift_node_dnsmasq')
-rwxr-xr-xroles/openshift_node_dnsmasq/files/networkmanager/99-origin-dns.sh6
1 files changed, 3 insertions, 3 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 df02bcf0e..230f0a28c 100755
--- a/roles/openshift_node_dnsmasq/files/networkmanager/99-origin-dns.sh
+++ b/roles/openshift_node_dnsmasq/files/networkmanager/99-origin-dns.sh
@@ -112,10 +112,10 @@ EOF
fi
sed -e '/^nameserver.*$/d' /etc/resolv.conf >> ${NEW_RESOLV_CONF}
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
+ if ! grep -qw search ${NEW_RESOLV_CONF}; then
echo 'search cluster.local' >> ${NEW_RESOLV_CONF}
+ elif ! grep -q 'search.*cluster.local' ${NEW_RESOLV_CONF}; then
+ sed -i '/^search/ s/$/ cluster.local/' ${NEW_RESOLV_CONF}
fi
cp -Z ${NEW_RESOLV_CONF} /etc/resolv.conf
fi