From 5398841cfeeb16b2404534d528a332a77eca8b5c Mon Sep 17 00:00:00 2001 From: Chris Long Date: Sat, 9 May 2020 13:38:57 -0700 Subject: [PATCH] Update bootstrap.sh --- Vagrant/bootstrap.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Vagrant/bootstrap.sh b/Vagrant/bootstrap.sh index bd98ccb..35ccaed 100644 --- a/Vagrant/bootstrap.sh +++ b/Vagrant/bootstrap.sh @@ -1,8 +1,10 @@ #! /bin/bash -# Override existing DNS Settings -echo -e " eth1:\n dhcp4: true\n nameservers:\n addresses: [8.8.8.8,8.8.4.4]" >> /etc/netplan/01-netcfg.yaml -netplan apply +# Override existing DNS Settings using netplan, but don't do it for Terraform builds +if ! curl -s 169.254.169.254 --connect-timeout 2 >/dev/null; then + echo -e " eth1:\n dhcp4: true\n nameservers:\n addresses: [8.8.8.8,8.8.4.4]" >> /etc/netplan/01-netcfg.yaml + netplan apply +fi sed -i 's/nameserver 127.0.0.53/nameserver 8.8.8.8/g' /etc/resolv.conf && chattr +i /etc/resolv.conf # Get a free Maxmind license here: https://www.maxmind.com/en/geolite2/signup