From ab66ced29c1a19eb47e440c08806635b0c5cae77 Mon Sep 17 00:00:00 2001 From: Yolanda Robla Date: Fri, 12 Jul 2019 13:34:39 +0200 Subject: [PATCH] Fix getting cluster_domain and changing dns The parameter for cluster_domain was not being propagated correctly, fixing it. Also always overwriting the openshift.conf file because right now, if domain was changed, it was not updated properly. Signed-off-by: Yolanda Robla Change-Id: I71d161846b63a11d76edf8b5386b19c63bdb4b44 --- utils/prep_host.sh | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/utils/prep_host.sh b/utils/prep_host.sh index cc51a53..5a1a38a 100755 --- a/utils/prep_host.sh +++ b/utils/prep_host.sh @@ -72,20 +72,13 @@ EOF # Set up NetworkManager DNS overlay dnsconf=/etc/NetworkManager/conf.d/openshift.conf - local dnschanged="" - if ! [ -f "${dnsconf}" ]; then - echo -e "[main]\ndns=dnsmasq" | sudo tee "${dnsconf}" - dnschanged=1 - fi + echo -e "[main]\ndns=dnsmasq" | sudo tee "${dnsconf}" + dnsmasqconf=/etc/NetworkManager/dnsmasq.d/openshift.conf - if ! [ -f "${dnsmasqconf}" ]; then - echo server=/$cluster_domain/192.168.126.1 | sudo tee "${dnsmasqconf}" - echo address=/.apps.$cluster_domain/192.168.126.51 | sudo tee -a "${dnsmasqconf}" - dnschanged=1 - fi - if [ -n "$dnschanged" ]; then - sudo systemctl restart NetworkManager - fi + rm $dnsmasqconf + echo server=/$cluster_domain/192.168.126.1 | sudo tee "${dnsmasqconf}" + echo address=/.apps.$cluster_domain/192.168.126.51 | sudo tee -a "${dnsmasqconf}" + sudo systemctl restart NetworkManager # Create an entry in the /etc/host grep -q 'libvirt.default' /etc/hosts @@ -109,4 +102,4 @@ then exit 1 fi -prerequisites +prerequisites $1 -- 2.16.6