Install reflector to rank mirrors
This commit is contained in:
parent
a7b8dfffdb
commit
fb075fe028
2 changed files with 30 additions and 10 deletions
11
files/reflector.service
Normal file
11
files/reflector.service
Normal 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
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue