From a8ec69941657975fe6a2b8616c3c729013a30dff Mon Sep 17 00:00:00 2001 From: Jose Luis Franco Arza Date: Fri, 3 May 2019 17:33:54 +0200 Subject: [PATCH] Clean up leftover mount point after docker stop. Some mountpoints are left on the host after docker shut down. This seems to be an issue with docker, but couldn't trace it back to a specific docker bug. In the meantime to unblock the upgrade CI we make sure that every mount point under /var/lib/docker are umounted before deleting that directory. Note that we need to keep the order right, so that we do a depth first list so that umount can do leaves before root. Closes-Bug: #1826375 Co-Authored-By: Sofer Athlan-Guyot Change-Id: I03a065556caca4385bb8b28be0dfbe21addbf003 --- deployment/podman/podman-baremetal-ansible.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/deployment/podman/podman-baremetal-ansible.yaml b/deployment/podman/podman-baremetal-ansible.yaml index 63f8f6c408..c9cf9cedff 100644 --- a/deployment/podman/podman-baremetal-ansible.yaml +++ b/deployment/podman/podman-baremetal-ansible.yaml @@ -117,6 +117,16 @@ outputs: package: name: docker state: absent + - name: Get the list of directory mounted under /var/lib/docker/ orderer. + shell: | + mount | awk '/\/var\/lib\/docker\/[^/]+\// {print $3}'; + mount | awk '/\/var\/lib\/docker\/[^/]+$/ {print $3}'; + register: unmounted_dirs + - name: Unmount those directories + mount: + path: "{{ item }}" + state: unmounted + loop: "{{ unmounted_dirs.stdout_lines }}" - name: Purge /var/lib/docker file: path: /var/lib/docker