From: Yolanda Robla Date: Fri, 12 Jul 2019 11:34:39 +0000 (+0200) Subject: Fix getting cluster_domain and changing dns X-Git-Tag: akraino_r2~52 X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F76%2F1176%2F1;p=kni%2Finstaller.git 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 --- 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