diff --git a/group_vars/all b/group_vars/all index c9c1d07..e7ed863 100644 --- a/group_vars/all +++ b/group_vars/all @@ -323,6 +323,7 @@ kdeconnect: mirrorlist: run_on: trusted + country: US units: run_on: trusted diff --git a/roles/mirrorlist/tasks/main.yml b/roles/mirrorlist/tasks/main.yml index b13de23..3b863c8 100644 --- a/roles/mirrorlist/tasks/main.yml +++ b/roles/mirrorlist/tasks/main.yml @@ -5,8 +5,8 @@ state: present - name: Push reflector update script - copy: - src: reflector-update.sh + template: + src: reflector-update.sh.j2 dest: /usr/local/bin/reflector-update mode: 0755 diff --git a/roles/mirrorlist/files/reflector-update.sh b/roles/mirrorlist/templates/reflector-update.sh.j2 similarity index 66% rename from roles/mirrorlist/files/reflector-update.sh rename to roles/mirrorlist/templates/reflector-update.sh.j2 index 7d0be48..99a6654 100644 --- a/roles/mirrorlist/files/reflector-update.sh +++ b/roles/mirrorlist/templates/reflector-update.sh.j2 @@ -1,6 +1,9 @@ #!/bin/bash - +# {{ ansible_managed} +# /usr/bin/reflector --latest 20 \ + {% if mirrorlist.country %}--country {{ mirrorlist.country }} \ + {% endif %} --sort rate \ --protocol https \ --save /etc/pacman.d/mirrorlist