diff --git a/roles/base/files/mirrorlist.hook b/roles/base/files/mirrorlist.hook index 5666827..425af3a 100644 --- a/roles/base/files/mirrorlist.hook +++ b/roles/base/files/mirrorlist.hook @@ -7,4 +7,4 @@ Target = pacman-mirrorlist Description = Updating mirror list... When = PostTransaction Depends = reflector -Exec = /usr/bin/bash -c "/usr/bin/reflector --latest 15 --sort rate --save /etc/pacman.d/mirrorlist && if [[ -f /etc/pacman.d/mirrorlist.pacnew ]] ; then rm /etc/pacman.d/mirrorlist.pacnew ; fi" +Exec = /usr/local/bin/reflector-update diff --git a/roles/base/files/pacman.conf b/roles/base/files/pacman.conf index a98de2d..561c489 100644 --- a/roles/base/files/pacman.conf +++ b/roles/base/files/pacman.conf @@ -1,9 +1,12 @@ [options] -HoldPkg = pacman glibc Architecture = auto -CheckSpace -SigLevel = Required DatabaseOptional +HoldPkg = pacman glibc +HookDir = /etc/pacman.d/hooks/ LocalFileSigLevel = Optional +SigLevel = Required DatabaseOptional + +CheckSpace +VerbosePkgLists [core] Include = /etc/pacman.d/mirrorlist diff --git a/roles/base/files/reflector-update.sh b/roles/base/files/reflector-update.sh new file mode 100644 index 0000000..7d0be48 --- /dev/null +++ b/roles/base/files/reflector-update.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +/usr/bin/reflector --latest 20 \ + --sort rate \ + --protocol https \ + --save /etc/pacman.d/mirrorlist + +if [[ -f /etc/pacman.d/mirrorlist.pacnew ]]; then + rm /etc/pacman.d/mirrorlist.pacnew +fi diff --git a/roles/base/tasks/packages.yml b/roles/base/tasks/packages.yml index ad4c6be..258048f 100644 --- a/roles/base/tasks/packages.yml +++ b/roles/base/tasks/packages.yml @@ -5,6 +5,14 @@ tags: - packages +- name: Push reflector update script + copy: + src: reflector-update.sh + dest: /usr/local/bin/reflector-update + mode: 0755 + tags: + - packages + - name: Create pacman hook directory file: path=/etc/pacman.d/hooks state=directory