1
1
mirror of https://gitlab.archlinux.org/archlinux/infrastructure.git synced 2025-01-18 08:06:16 +01:00

tasks/upgrade-servers: tweak pacman upgrade logic

Avoid updating the cache in the same task w/ the upgrade as the former
causes the combined task to always return changed=True. For up-to-date
hosts, stop early instead of following through to the end and skipping
the final reboot task.

Before Ansible 5.4.0, combined cache update + package upgrade would not
always return changed=True but instead depended on whether the were any
packages to upgrade.
This commit is contained in:
Evangelos Foutras 2022-03-05 17:06:00 +02:00
parent 551c6735bf
commit 7d5fd109dd
No known key found for this signature in database
GPG Key ID: 51E8B148A9999C34

@ -8,10 +8,13 @@
- name: upgrade all packages
pacman:
update_cache: yes
upgrade: yes
register: pacman_upgrade
- name: stop if no packages were upgraded
meta: end_host
when: pacman_upgrade is not changed
- name: check for running builds
block:
- name: list build-related processes
@ -59,4 +62,3 @@
- name: reboot
reboot:
when: pacman_upgrade is changed