diff --git a/builders/gw_translations_gcp.yaml b/builders/gw_translations_gcp.yaml index 99a7f6b..b5ac034 100644 --- a/builders/gw_translations_gcp.yaml +++ b/builders/gw_translations_gcp.yaml @@ -13,6 +13,7 @@ script_directories: - ubuntu-jammy - ubuntu-worker-requirements - ubuntu-cuda + - ubuntu-dnsmasq - generic-worker-linux - worker-runner-linux - worker-runner-gw-systemd # TODO: merge with 'generic-worker-linux'? diff --git a/scripts/ubuntu-dnsmasq/01-switch-to-dnsmasq.sh b/scripts/ubuntu-dnsmasq/01-switch-to-dnsmasq.sh new file mode 100644 index 0000000..7cb6894 --- /dev/null +++ b/scripts/ubuntu-dnsmasq/01-switch-to-dnsmasq.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +set -exv + +# init helpers +helpers_dir=${MONOPACKER_HELPERS_DIR:-"/etc/monopacker/scripts"} +for h in ${helpers_dir}/*.sh; do + . $h; +done + +# install dnsmasq before disabling systemd-resolved, because we need working +# dns to do so +apt-get install -y dnsmasq +# disable systemd-resolved +systemctl stop systemd-resolved +systemctl disable systemd-resolved +# remove symlink to systemd-resolved's resolv.conf; replace it with a version +# that points at the dnsmasq server that's about to start up +rm /etc/resolv.conf +echo "nameserver 127.0.0.1" > /etc/resolv.conf +echo "server=8.8.8.8" >> /etc/dnsmasq.conf +systemctl start dnsmasq +systemctl enable dnsmasq