diff options
author | Scott Dodson <sdodson@redhat.com> | 2016-05-10 13:53:37 -0400 |
---|---|---|
committer | Scott Dodson <sdodson@redhat.com> | 2016-05-12 13:11:50 -0400 |
commit | 7521e4859bc3c44a11086085b77540f639414db4 (patch) | |
tree | 2ed01f0ce00a8cffeaa38fea5f818eb45cb525a8 /roles | |
parent | 57ac47b9d3429994f60f5e3494507c697557f297 (diff) | |
download | openshift-7521e4859bc3c44a11086085b77540f639414db4.tar.gz openshift-7521e4859bc3c44a11086085b77540f639414db4.tar.bz2 openshift-7521e4859bc3c44a11086085b77540f639414db4.tar.xz openshift-7521e4859bc3c44a11086085b77540f639414db4.zip |
Use IP4_NAMESERVERS rather than DHCP4_DOMAIN_NAME_SERVERS
Only modify resolv.conf if IP4_NAMESERVERS is defined, it's not safe to do so
otherwise.
Diffstat (limited to 'roles')
-rwxr-xr-x | roles/openshift_node_dnsmasq/files/networkmanager/99-origin-dns.sh | 7 |
1 files changed, 4 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 691fa32f3..bc7c29636 100755 --- a/roles/openshift_node_dnsmasq/files/networkmanager/99-origin-dns.sh +++ b/roles/openshift_node_dnsmasq/files/networkmanager/99-origin-dns.sh @@ -31,7 +31,8 @@ if [[ $2 =~ ^(up|dhcp4-change)$ ]]; then def_route=$(/sbin/ip route list match 0.0.0.0/0 | awk '{print $3 }') def_route_int=$(/sbin/ip route get to ${def_route} | awk '{print $3}') def_route_ip=$(/sbin/ip route get to ${def_route} | awk '{print $5}') - if [[ ${DEVICE_IFACE} == ${def_route_int} ]]; then + if [[ ${DEVICE_IFACE} == ${def_route_int} && \ + -n "${IP4_NAMESERVERS}" ]]; then if [ ! -f /etc/dnsmasq.d/origin-dns.conf ]; then cat << EOF > /etc/dnsmasq.d/origin-dns.conf strict-order @@ -42,8 +43,8 @@ server=/30.172.in-addr.arpa/172.30.0.1 EOF fi # zero out our upstream servers list and feed it into dnsmasq - echo '' > /etc/dnsmasq.d/origin-upstream-dns.conf - for ns in ${DHCP4_DOMAIN_NAME_SERVERS}; do + echo -n > /etc/dnsmasq.d/origin-upstream-dns.conf + for ns in ${IP4_NAMESERVERS}; do echo "server=${ns}" >> /etc/dnsmasq.d/origin-upstream-dns.conf done systemctl restart dnsmasq |