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:
parent
551c6735bf
commit
7d5fd109dd
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user