mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-10-30 22:16:23 -02:30
fix/ansible 2.19: reset: no implicit conditionals (#13485)
This commit is contained in:
@@ -167,23 +167,25 @@
|
|||||||
when: services_removed_secondary.changed
|
when: services_removed_secondary.changed
|
||||||
|
|
||||||
- name: Reset | gather mounted kubelet dirs
|
- name: Reset | gather mounted kubelet dirs
|
||||||
shell: set -o pipefail && mount | grep /var/lib/kubelet/ | awk '{print $3}' | tac
|
mount_facts:
|
||||||
args:
|
on_timeout: ignore
|
||||||
executable: /bin/bash
|
timeout: 15
|
||||||
check_mode: false
|
include_aggregate_mounts: true
|
||||||
|
sources:
|
||||||
|
- dynamic
|
||||||
register: mounted_dirs
|
register: mounted_dirs
|
||||||
failed_when: false
|
|
||||||
changed_when: false
|
|
||||||
tags:
|
tags:
|
||||||
- mounts
|
- mounts
|
||||||
|
|
||||||
- name: Reset | unmount kubelet dirs
|
- name: Reset | unmount kubelet dirs
|
||||||
command: umount -f {{ item }}
|
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
|
register: umount_dir
|
||||||
when: mounted_dirs
|
|
||||||
retries: 4
|
retries: 4
|
||||||
until: umount_dir.rc == 0
|
until: umount_dir is success
|
||||||
delay: 5
|
delay: 5
|
||||||
tags:
|
tags:
|
||||||
- mounts
|
- mounts
|
||||||
|
|||||||
Reference in New Issue
Block a user