From b60b0d58781b4f43dc5ab4ef9955755bd6cb918a Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Wed, 9 Dec 2020 12:24:11 +0000 Subject: [PATCH] Fix prechecks with Docker 20.10.0 The 'prechecks : Checking Docker version' task previously failed with Docker 20.10.0. The regex used to parse the version was returning 0.10.0, which is not above the minimum. The previous version of 19.x would have been parsed as 9.x, which is above the minimum. This change fixes the issue by matching the beginning and end of the version using \b. Depends-On: https://review.opendev.org/766183 Change-Id: I2a23eea7effb5b9a5e73361bcd48bd2e16d1569c Closes-Bug: 1907436 --- ansible/roles/prechecks/tasks/service_checks.yml | 2 +- releasenotes/notes/bug-1907436-2da50ed38d107127.yaml | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/bug-1907436-2da50ed38d107127.yaml diff --git a/ansible/roles/prechecks/tasks/service_checks.yml b/ansible/roles/prechecks/tasks/service_checks.yml index a3bc00ff60..73809a6b15 100644 --- a/ansible/roles/prechecks/tasks/service_checks.yml +++ b/ansible/roles/prechecks/tasks/service_checks.yml @@ -6,7 +6,7 @@ changed_when: false when: inventory_hostname in groups['baremetal'] failed_when: result is failed - or result.stdout | regex_replace('.*(\\d+\\.\\d+\\.\\d+).*', '\\1') is version(docker_version_min, '<') + or result.stdout | regex_replace('.*\\b(\\d+\\.\\d+\\.\\d+)\\b.*', '\\1') is version(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 diff --git a/releasenotes/notes/bug-1907436-2da50ed38d107127.yaml b/releasenotes/notes/bug-1907436-2da50ed38d107127.yaml new file mode 100644 index 0000000000..1d09da155b --- /dev/null +++ b/releasenotes/notes/bug-1907436-2da50ed38d107127.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Fixes an issue with the ``kolla-ansible prechecks`` command with Docker + 20.10. `LP#1907436 + `__