Skip to content
Snippets Groups Projects
Verified Commit 63167c97 authored by Jelle van der Waa's avatar Jelle van der Waa :construction:
Browse files

Switch to Geo IP mirrors

Reflector can take a long time to figure out the best mirrors and blocks
ssh access which makes some automation slow (Waiting longer then 1
minute on a functioning server). This approach is similiar to what we
have for our docker images.
parent 7a553ea4
No related branches found
No related tags found
No related merge requests found
......@@ -76,7 +76,7 @@ EOF
echo "Server = ${MIRROR}" >mirrorlist
# We use the hosts package cache
pacstrap -c -C pacman.conf -M "${MOUNT}" base linux grub openssh sudo btrfs-progs reflector
pacstrap -c -C pacman.conf -M "${MOUNT}" base linux grub openssh sudo btrfs-progs
cp mirrorlist "${MOUNT}/etc/pacman.d/"
}
......
......@@ -36,22 +36,11 @@ ExecStart=/usr/bin/pacman-key --populate
WantedBy=multi-user.target
EOF
# Add service for running reflector on first boot
cat <<EOF >"${MOUNT}/etc/systemd/system/reflector-init.service"
[Unit]
Description=Initializes mirrors for the VM
After=network-online.target
Wants=network-online.target
Before=sshd.service cloud-final.service
ConditionFirstBoot=yes
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=reflector --latest 20 --protocol https --sort rate --save /etc/pacman.d/mirrorlist
[Install]
WantedBy=multi-user.target
# Setup mirror list to Geo IP mirrors
cat <<EOF >"${MOUNT}/etc/pacman.d/mirrorlist"
Server = https://geo.mirror.pkgbuild.com/\$repo/os/\$arch
Server = https://mirror.rackspace.com/archlinux/\$repo/os/\$arch
Server = https://mirror.leaseweb.net/archlinux/\$repo/os/\$arch
EOF
# enabling important services
......@@ -63,7 +52,6 @@ systemctl enable systemd-resolved
systemctl enable systemd-timesyncd
systemctl enable systemd-time-wait-sync
systemctl enable pacman-init.service
systemctl enable reflector-init.service
EOF
# GRUB
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment