From deaf085cdb902e5b5404280c84b96511e83b20ac Mon Sep 17 00:00:00 2001 From: Michael Gugino Date: Mon, 12 Feb 2018 14:00:05 -0500 Subject: Fix docker_upgrade variable Currently, docker_upgrade is ignored during cluster upgrades. This commit ensures that the variable is respected. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1543714 --- .../container_runtime/tasks/docker_upgrade_check.yml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'roles/container_runtime/tasks') diff --git a/roles/container_runtime/tasks/docker_upgrade_check.yml b/roles/container_runtime/tasks/docker_upgrade_check.yml index 8dd916e79..4a341b744 100644 --- a/roles/container_runtime/tasks/docker_upgrade_check.yml +++ b/roles/container_runtime/tasks/docker_upgrade_check.yml @@ -36,14 +36,16 @@ failed_when: false changed_when: false -- fail: - msg: This playbook requires access to Docker 1.12 or later +- name: Required docker version not available (non-atomic) + fail: + msg: "This playbook requires access to Docker {{ l_required_docker_version }} or later" # Disable the 1.12 requirement if the user set a specific Docker version when: - not openshift_is_atomic | bool - docker_version is not defined - - docker_upgrade is not defined or docker_upgrade | bool == True - - (pkg_check.rc == 0 and (avail_docker_version.stdout == "" or avail_docker_version.stdout is version_compare('1.12','<'))) + - docker_upgrade | bool + - pkg_check.rc == 0 + - avail_docker_version.stdout == "" or avail_docker_version.stdout is version_compare(l_required_docker_version,'<') # Default l_docker_upgrade to False, we'll set to True if an upgrade is required: - set_fact: @@ -54,7 +56,8 @@ docker_version: "{{ avail_docker_version.stdout }}" when: - not openshift_is_atomic | bool - - pkg_check.rc == 0 and docker_version is not defined + - pkg_check.rc == 0 + - docker_version is not defined - name: Flag for Docker upgrade if necessary set_fact: @@ -74,8 +77,9 @@ l_docker_version: "{{ g_atomic_docker_version_result.stdout | from_yaml }}" when: openshift_is_atomic | bool -- fail: - msg: This playbook requires access to Docker 1.12 or later +- name: Required docker version is unavailable (atomic) + fail: + msg: "This playbook requires access to Docker {{ l_required_docker_version }} or later" when: - openshift_is_atomic | bool - - l_docker_version.avail_version | default(l_docker_version.curr_version, true) is version_compare('1.12','<') + - l_docker_version.avail_version | default(l_docker_version.curr_version, true) is version_compare(l_required_docker_version,'<') -- cgit v1.2.3