aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/roles/rate_mirrors/tasks
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2023-05-21 19:01:59 +0200
committerEgor Tensin <Egor.Tensin@gmail.com>2023-05-21 19:01:59 +0200
commitf20e3bf3557451047a3ab035de503cd2ce35a550 (patch)
treeaee99bb289cf4ca1a85ac983e8148f2eb1b8d82c /roles/rate_mirrors/tasks
parentmy_server: update docker-compose flags (diff)
downloadmaintenance-f20e3bf3557451047a3ab035de503cd2ce35a550.tar.gz
maintenance-f20e3bf3557451047a3ab035de503cd2ce35a550.zip
fix some ansible-lint warnings
Diffstat (limited to 'roles/rate_mirrors/tasks')
-rw-r--r--roles/rate_mirrors/tasks/main.yml22
1 files changed, 13 insertions, 9 deletions
diff --git a/roles/rate_mirrors/tasks/main.yml b/roles/rate_mirrors/tasks/main.yml
index 8777fbd..4d76ff3 100644
--- a/roles/rate_mirrors/tasks/main.yml
+++ b/roles/rate_mirrors/tasks/main.yml
@@ -1,41 +1,45 @@
-- become: true
+- name: As root user
+ become: true
block:
- - when: etc_versioned
+ - name: Fail if there're uncommitted changes in /etc
+ when: etc_versioned
block:
- name: Check for changes in /etc
- command: git status --porcelain=v1
+ ansible.builtin.command: git status --porcelain=v1
args:
chdir: /etc
register: git_status
changed_when: false
failed_when: false
- - fail:
+ - ansible.builtin.fail:
msg: There are uncommitted changes in /etc
when: git_status.stdout
- name: Rate pacman mirrors
- shell: |
+ ansible.builtin.shell: |
. /etc/os-release && rate-mirrors \
--allow-root \
--disable-comments \
--save=/etc/pacman.d/mirrorlist \
"$ID"
- - when: etc_versioned
+ - name: Commit pacman.d/mirrorlist
+ when: etc_versioned
block:
- name: Check for changes in /etc
- command: git status --porcelain=v1
+ ansible.builtin.command: git status --porcelain=v1
args:
chdir: /etc
register: git_status
changed_when: false
failed_when: false
- - fail:
+ - name: Fail if there're other uncommitted changes
+ ansible.builtin.fail:
msg: How did this happen?
when: git_status.stdout != ' M pacman.d/mirrorlist'
- name: Commit changes in /etc/pacman.d/mirrorlist
- command: |
+ ansible.builtin.command: |
etckeeper commit 'rate-mirrors'