From bae2ef64a40e14501a02d48448792ecad5729f69 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Sat, 29 Jul 2023 19:24:06 +0100 Subject: [PATCH] Use reflector timer not manual cron --- dotfiles.yml | 3 --- files/reflector.conf | 16 ++++++++++++++++ galaxy-requirements.yml | 1 - tasks/packages.yml | 16 +++++++++++++++- 4 files changed, 31 insertions(+), 5 deletions(-) create mode 100644 files/reflector.conf diff --git a/dotfiles.yml b/dotfiles.yml index 0a24cb3..8d64e9d 100644 --- a/dotfiles.yml +++ b/dotfiles.yml @@ -17,9 +17,6 @@ - include_role: name: geerlingguy.ntp - - include_role: - name: realorangeone.reflector - - import_tasks: tasks/boot.yml - import_tasks: tasks/i3.yml - import_tasks: tasks/network.yml diff --git a/files/reflector.conf b/files/reflector.conf new file mode 100644 index 0000000..658ed42 --- /dev/null +++ b/files/reflector.conf @@ -0,0 +1,16 @@ +# Reflector configuration file for the systemd service. + +# Set the output path where the mirrorlist will be saved (--save). +--save /etc/pacman.d/mirrorlist + +# Select the transfer protocol (--protocol). +--protocol https + +# Sort the mirrors by speed. +--sort rate + +# Only consider recently synced mirrors +--age 24 + +# Multi-threaded +--threads {{ ansible_facts.processor_vcpus }} diff --git a/galaxy-requirements.yml b/galaxy-requirements.yml index 4c3cf86..94f648d 100644 --- a/galaxy-requirements.yml +++ b/galaxy-requirements.yml @@ -5,4 +5,3 @@ collections: roles: - src: geerlingguy.ntp - - src: realorangeone.reflector diff --git a/tasks/packages.yml b/tasks/packages.yml index 2785fba..bb20740 100644 --- a/tasks/packages.yml +++ b/tasks/packages.yml @@ -92,6 +92,20 @@ - name: Install pacman tools kewlfft.aur.aur: - name: pacman-contrib + name: "{{ item }}" + loop: + - pacman-contrib + - reflector become: true become_user: aur_builder + +- name: Install reflector config + template: + src: ./files/reflector.conf + dest: /etc/xdg/reflector/reflector.conf + mode: 0644 + +- name: Enable reflector + systemd: + name: reflector + enabled: true