From e4eb65dba2091cbedb11278073a364608c09a421 Mon Sep 17 00:00:00 2001 From: Max Gautier Date: Thu, 10 Sep 2026 09:04:35 +0000 Subject: [PATCH] fix/ansible 2.19: reset: no implicit conditionals (#13485) --- roles/reset/tasks/main.yml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/roles/reset/tasks/main.yml b/roles/reset/tasks/main.yml index ecf06fa5e..33f4afadb 100644 --- a/roles/reset/tasks/main.yml +++ b/roles/reset/tasks/main.yml @@ -167,23 +167,25 @@ when: services_removed_secondary.changed - name: Reset | gather mounted kubelet dirs - shell: set -o pipefail && mount | grep /var/lib/kubelet/ | awk '{print $3}' | tac - args: - executable: /bin/bash - check_mode: false + mount_facts: + on_timeout: ignore + timeout: 15 + include_aggregate_mounts: true + sources: + - dynamic register: mounted_dirs - failed_when: false - changed_when: false tags: - mounts - name: Reset | unmount kubelet dirs command: umount -f {{ item }} - with_items: "{{ mounted_dirs.stdout_lines }}" + # TODO: use a simple default after ansible-core>=2.19 + loop: "{{ (mounted_dirs.ansible_facts.aggregate_mounts if mounted_dirs.ansible_facts is defined else []) + | map(attribute='mount') + | select('match', '/var/lib/kubelet/.*') | reverse }}" register: umount_dir - when: mounted_dirs retries: 4 - until: umount_dir.rc == 0 + until: umount_dir is success delay: 5 tags: - mounts