Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: setting acs-mirror to atm #5465

Draft
wants to merge 5 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions vhdbuilder/packer/overwrite-acs-mirror-cname.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/bin/bash
apt update
apt install -y bind9 bind9utils bind9-doc
sed -i s/"-u bind"/"-u bind -4"/g /etc/default/named

cat <<EOF > /etc/bind/named.conf.options
options {
directory "/var/cache/bind";
recursion yes;
version "not currently available";
allow-recursion { 127.0.0.1; 192.168.1.0/24; };
response-policy { zone "rpz"; };
dnssec-validation auto;
};
EOF

cat <<EOF > /etc/bind/db.rpz
\$TTL 60
@ IN SOA localhost. root.localhost. (
2015112501 ; serial
1h ; refresh
30m ; retry
1w ; expiry
30m) ; minimum
IN NS localhost.

localhost A 127.0.0.1

acs-mirror.azureedge.net CNAME acs-mirror-migration.trafficmanager.net.
EOF

cat <<EOF > /etc/bind/named.conf.local
zone "rpz" {
type master;
file "/etc/bind/db.rpz";
};
EOF

systemctl restart named
systemctl enable named

#####
# OVERWRITE LOCAL DNS
####

sed -i s/#DNS=/DNS=127.0.0.1/g /etc/systemd/resolved.conf
service systemd-resolved restart
ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf
13 changes: 13 additions & 0 deletions vhdbuilder/packer/vhd-image-builder-base.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,19 @@
}
],
"provisioners": [
{
"type": "file",
"source": "vhdbuilder/packer/overwrite-acs-mirror-cname.sh",
"destination": "/home/packer/overwrite-acs-mirror-cname.sh"
},
{
"type": "shell",
"inline": [
"chmod +x /home/packer/overwrite-acs-mirror-cname.sh",
"sudo /home/packer/overwrite-acs-mirror-cname.sh",
"dig acs-mirror.azureedge.net"
]
},
{
"type": "shell",
"inline": [
Expand Down