summaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
authorScott Dodson <sdodson@redhat.com>2016-11-17 15:50:06 -0500
committerScott Dodson <sdodson@redhat.com>2016-11-17 15:51:01 -0500
commit477a8171069402237f11523052017c79f53700b0 (patch)
treeaf3550526b491a61ecc534703af2a296ca2e6e86 /roles
parent03a5504a653879fc8c1ed482146b64eafdccc4da (diff)
downloadopenshift-477a8171069402237f11523052017c79f53700b0.tar.gz
openshift-477a8171069402237f11523052017c79f53700b0.tar.bz2
openshift-477a8171069402237f11523052017c79f53700b0.tar.xz
openshift-477a8171069402237f11523052017c79f53700b0.zip
node_dnsmasq -- Set dnsmasq as our only nameserver
Diffstat (limited to 'roles')
-rwxr-xr-xroles/openshift_node_dnsmasq/files/networkmanager/99-origin-dns.sh5
1 files changed, 4 insertions, 1 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 ced0fa663..66f2b5324 100755
--- a/roles/openshift_node_dnsmasq/files/networkmanager/99-origin-dns.sh
+++ b/roles/openshift_node_dnsmasq/files/networkmanager/99-origin-dns.sh
@@ -85,7 +85,10 @@ EOF
systemctl restart dnsmasq
fi
- sed -i '0,/^nameserver/ s/^nameserver.*$/nameserver '"${def_route_ip}"'/g' /etc/resolv.conf
+ # Only if dnsmasq is running properly make it our only nameserver
+ if `systemctl -q is-active dnsmasq.service`; then
+ sed -i -e '/^nameserver.*$/d' -e 'a\nameserver '"${def_route_ip}"'\' /etc/resolv.conf
+ fi
if ! grep -q '99-origin-dns.sh' /etc/resolv.conf; then
echo "# nameserver updated by /etc/NetworkManager/dispatcher.d/99-origin-dns.sh" >> /etc/resolv.conf