Install reflector to rank mirrors

This commit is contained in:
Jake Howard 2019-10-06 16:32:35 +01:00
parent a7b8dfffdb
commit fb075fe028
Signed by: jake
GPG key ID: 57AFB45680EDD477
2 changed files with 30 additions and 10 deletions

11
files/reflector.service Normal file
View file

@ -0,0 +1,11 @@
[Unit]
Description=Pacman mirrorlist update
Wants=network-online.target
After=network-online.target
[Service]
Type=oneshot
ExecStart=/usr/bin/reflector --verbose --sort rate -a 1 -p https --threads {{ ansible_facts.processor_vcpus }} --save /etc/pacman.d/mirrorlist
[Install]
RequiredBy=multi-user.target

View file

@ -89,14 +89,23 @@
regexp: '^BUILDENV=' regexp: '^BUILDENV='
line: 'BUILDENV=(!distcc color ccache check !sign)' line: 'BUILDENV=(!distcc color ccache check !sign)'
- name: Download UK mirrorlist - name: "Install Reflector"
get_url: aur:
url: 'https://www.archlinux.org/mirrorlist/?country=GB&protocol=http&protocol=https&ip_version=4&ip_version=6&use_mirror_status=on' skip_installed: true
dest: /etc/pacman.d/mirrorlist name: reflector
force: true become: true
become_user: aur_builder
- name: Un-comment mirrorlist servers - name: Install Reflector service
replace: template:
path: /etc/pacman.d/mirrorlist src: ./files/reflector.service
regexp: '^#Server = (.+)$' dest: /etc/systemd/system/reflector.service
replace: 'Server = \1' mode: 0644
owner: root
group: root
- name: Enable Reflector services
systemd:
name: "reflector"
enabled: true
state: started