From d1ddeddb67813923f335fa069c18d7b64e00742b Mon Sep 17 00:00:00 2001 From: chenxing Date: Sat, 13 Jan 2018 14:22:40 +0800 Subject: [PATCH] Fix the Prechecks failed while checking docker version In Docker version 18.01.0-ce, "docker version" command uses the "\t" to format the result, which will cause the prechecks failed. There is a workaround that using "docker --version" command instead of "docker version" can get everything running. Also, using "docker --version" to check the version of docker is more specific and effective. backport: pike ocata Change-Id: Ie5efe1888afc3be11441a88d627db62e1575f3ed Closes-Bug: #1742869 --- ansible/roles/prechecks/tasks/service_checks.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ansible/roles/prechecks/tasks/service_checks.yml b/ansible/roles/prechecks/tasks/service_checks.yml index 3a739c595e..e1b8a45dff 100644 --- a/ansible/roles/prechecks/tasks/service_checks.yml +++ b/ansible/roles/prechecks/tasks/service_checks.yml @@ -1,11 +1,11 @@ --- - name: Checking Docker version - command: docker version + command: docker --version register: result changed_when: false when: inventory_hostname in groups['baremetal'] failed_when: result | failed - or (result.stdout | from_yaml).Server.Version | regex_replace('(\\d+\\.\\d+\\.\\d+).*', '\\1') | version_compare(docker_version_min, '<') + or result.stdout | regex_replace('.*(\\d+\\.\\d+\\.\\d+).*', '\\1') | version_compare(docker_version_min, '<') # NOTE(mgoddard): If passwords.yml is encrypted using ansible-vault, this check # will pass, but only because nothing in the vault file has the format of a