From 0f0858703ba96e01f0d01b4ad3eac48c58c268fe Mon Sep 17 00:00:00 2001 From: Alexander Block Date: Tue, 13 Dec 2016 14:21:24 +0100 Subject: [PATCH] Fix reverse umount in reset role The Jinja2 filter 'reverse' returned an iterator instead of a list, resulting in the umount task to fail. Intead of using the reverse filter, we use 'tac' to reverse the output of the previous task. --- roles/reset/tasks/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/reset/tasks/main.yml b/roles/reset/tasks/main.yml index bdacbbfc4..1e978cf71 100644 --- a/roles/reset/tasks/main.yml +++ b/roles/reset/tasks/main.yml @@ -24,12 +24,12 @@ shell: docker ps -aq | xargs -r docker rm -fv - name: reset | gather mounted kubelet dirs - shell: mount | grep /var/lib/kubelet | awk '{print $3}' + shell: mount | grep /var/lib/kubelet | awk '{print $3}' | tac register: mounted_dirs - name: reset | unmount kubelet dirs command: umount {{item}} - with_items: '{{ mounted_dirs.stdout_lines | reverse }}' + with_items: '{{ mounted_dirs.stdout_lines }}' - name: reset | delete some files and directories file: path={{ item }} state=absent