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 <sathlang@redhat.com>

Change-Id: I03a065556caca4385bb8b28be0dfbe21addbf003
This commit is contained in:
Jose Luis Franco Arza 2019-05-03 17:33:54 +02:00
parent 17f70ba91e
commit a8ec699416
1 changed files with 10 additions and 0 deletions

View File

@ -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