aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <egor@tensin.name>2025-11-14 15:16:34 +0100
committerEgor Tensin <egor@tensin.name>2025-11-14 15:42:52 +0100
commitd628231d593494acfe2634da950381678af77dc2 (patch)
tree759fef56dcaeb85c102e7a9b9f441053a9a2430a
parentdocker: fix systemd service configuration (diff)
downloadinfra-ansible-d628231d593494acfe2634da950381678af77dc2.tar.gz
infra-ansible-d628231d593494acfe2634da950381678af77dc2.zip
pacman: ignore simple cache updates
-rw-r--r--roles/pacman/tasks/main.yml5
1 files changed, 5 insertions, 0 deletions
diff --git a/roles/pacman/tasks/main.yml b/roles/pacman/tasks/main.yml
index 2b613b9..d4635e9 100644
--- a/roles/pacman/tasks/main.yml
+++ b/roles/pacman/tasks/main.yml
@@ -23,6 +23,11 @@
update_cache: true
upgrade: true
register: pacman_result
+ # According to
+ # https://docs.ansible.com/projects/ansible/latest/collections/community/general/pacman_module.html
+ # this module now reports 'changed' even if only the cache was updated, with
+ # no upgrades; this is the workaround.
+ changed_when: pacman_result.packages is defined and (pacman_result.packages | length > 0)
notify: pacman_upgraded
- name: Reboot if necessary