From 5e1ba52f791835ff03aa8d6459354600b55db8fc Mon Sep 17 00:00:00 2001 From: Alex Schultz Date: Thu, 25 Oct 2018 15:23:30 -0600 Subject: [PATCH] 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 --- tasks/docker.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tasks/docker.yml b/tasks/docker.yml index 1841fb1..46474a0 100644 --- a/tasks/docker.yml +++ b/tasks/docker.yml @@ -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