Skip to content

Commit

Permalink
Let's try it for real
Browse files Browse the repository at this point in the history
  • Loading branch information
brianseeders committed Apr 24, 2024
1 parent 075ad95 commit f24931b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .buildkite/hooks/pre-command
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,17 @@ EOF
<summary>Agent information from gobld</summary>
EOF
fi

# Amazon Linux 2 has DNS resolution issues with resource-based hostnames in EC2
# We have many functional tests that try to lookup and resolve the hostname of the local machine in a particular way
# And they fail. This sets up dnsmasq locally and sets up a manual entry for the hostname.
if [[ -f /etc/os-release ]] && grep -q '"Amazon Linux 2"' /etc/os-release; then
sudo yum install -y dnsmasq bind-utils
echo 'addn-hosts=/etc/dnsmasq.hosts' | sudo tee -a /etc/dnsmasq.conf
echo "$(hostname -i | cut -d' ' -f 2) $(hostname -f)." | sudo tee /etc/dnsmasq.hosts
sudo bash -c "echo 'nameserver 169.254.169.253' > /etc/resolv.dnsmasq"
sudo systemctl restart dnsmasq.service

sudo bash -c "echo 'supersede domain-name-servers 127.0.0.1, 169.254.169.253;' >> /etc/dhcp/dhclient.conf"
sudo dhclient
fi

0 comments on commit f24931b

Please sign in to comment.