Add xfs ftype check during install

Since we know xfs ftype=0 is incompatible with the container usage,
let's fail hard with a message if the system has an improperly
configured filesystem.

Change-Id: I06f80003d7f3f6443f75f39973d4e68ac24673be
Related-Bug: #1765121
This commit is contained in:
Alex Schultz 2018-10-25 15:23:30 -06:00
parent f0fab9b956
commit 5e1ba52f79
1 changed files with 25 additions and 0 deletions

View File

@ -10,6 +10,31 @@
state: present
reload: yes
# NOTE(aschultz): LP#1765121 - need to check that we don't have any ftype=0
# volumes because other wise docker is very unhappy
- name: Check if there are XFS volumes with ftype=0
become: true
shell: |
for dev in $(df -h | grep '/dev/' | grep -v 'tmp' | cut -d' ' -f1)
do
parseftype=$(xfs_info $dev | grep ftype=0);
if [[ ! -z "$parseftype" ]]; then
ftype="ftype=0";
break;
fi
done
echo $ftype;
register: ftype
changed_when: false
- name: Check ftype
fail:
msg: >
XFS volumes formatted using ftype=0 are incompatible
with the docker overlayfs driver.
when:
- ftype.stdout == 'ftype=0'
- name: ensure docker is installed
package:
name: docker