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
(cherry picked from commit d1ddeddb67)
This commit is contained in:
chenxing 2018-01-13 14:22:40 +08:00 committed by zhongshengping
parent 6ed1663cec
commit daf0dd2b76
1 changed files with 2 additions and 2 deletions

View File

@ -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, '<')
- name: Checking empty passwords in passwords.yml. Run kolla-genpwd if this task fails
local_action: command grep '^[^#].*:\s*$' "{{ CONFIG_DIR | default('/etc/kolla') }}/passwords.yml"