diff options
author | Devan Goodwin <dgoodwin@redhat.com> | 2016-06-27 15:44:04 -0300 |
---|---|---|
committer | Devan Goodwin <dgoodwin@redhat.com> | 2016-06-27 15:44:04 -0300 |
commit | f004b526078b78b0ba9435b82af4d4f4d42de5e2 (patch) | |
tree | db6d63cc97636c6c03185b7047122b723615b403 /playbooks/common/openshift-cluster/upgrades/docker/upgrade_check.yml | |
parent | 08f1caed84d46d0263f0c1aaaf2da891946b1a96 (diff) | |
download | openshift-f004b526078b78b0ba9435b82af4d4f4d42de5e2.tar.gz openshift-f004b526078b78b0ba9435b82af4d4f4d42de5e2.tar.bz2 openshift-f004b526078b78b0ba9435b82af4d4f4d42de5e2.tar.xz openshift-f004b526078b78b0ba9435b82af4d4f4d42de5e2.zip |
More docker upgrade fixes.
Diffstat (limited to 'playbooks/common/openshift-cluster/upgrades/docker/upgrade_check.yml')
-rw-r--r-- | playbooks/common/openshift-cluster/upgrades/docker/upgrade_check.yml | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/playbooks/common/openshift-cluster/upgrades/docker/upgrade_check.yml b/playbooks/common/openshift-cluster/upgrades/docker/upgrade_check.yml index 7fd4657d5..0a70ab723 100644 --- a/playbooks/common/openshift-cluster/upgrades/docker/upgrade_check.yml +++ b/playbooks/common/openshift-cluster/upgrades/docker/upgrade_check.yml @@ -1,13 +1,11 @@ --- -# This snippet determines if docker_upgrade should be set for the host. If it's already -# set via the inventory we will respect it. Otherwise we check if the current version -# is equal to the either the latest, or the requested docker_version, and set -# docker_upgrade accordingly. +# This snippet determines if a Docker upgrade is required by checking the inventory +# variables, the available packages, and sets l_docker_version to True if so. -- name: Determine available Docker version - script: ../../../../common/openshift-cluster/upgrades/files/rpm_versions.sh docker - register: g_docker_version_result +- set_fact: + docker_upgrade: True + when: docker_upgrade is not defined - name: Check if Docker is installed command: rpm -q docker @@ -32,24 +30,22 @@ # Disable the 1.10 requirement if the user set a specific Docker version when: avail_docker_version.stdout | version_compare('1.10','<') and docker_version is not defined -# We respect docker_upgrade=False in the inventory, but True is the default and -# if set in inventory, we still flip it to False here and only set to true if -# they're not already running the required version. +# Default l_docker_upgrade to False, we'll set to True if an upgrade is required: - set_fact: - docker_upgrade: False - when: docker_upgrade is not defined or docker_upgrade | bool + l_docker_upgrade: False # Make sure a docker_verison is set if none was requested: - set_fact: - docker_version: avail_docker_version.stdout + docker_version: "{{ avail_docker_version.stdout }}" when: docker_version is not defined - name: Flag for Docker upgrade if necessary set_fact: - docker_upgrade: True - when: docker_version is defined and pkg_check.rc == 0 and curr_docker_version.stdout | version_compare(docker_version,'<') + l_docker_upgrade: True + when: pkg_check.rc == 0 and curr_docker_version.stdout | version_compare(docker_version,'<') - name: Flag to delete all images prior to upgrade if crossing Docker 1.10 boundary set_fact: docker_upgrade_nuke_images: True - when: docker_upgrade_nuke_images is not defined and docker_upgrade | bool and curr_docker_version.stdout | version_compare('1.10','<') and docker_version | version_compare('1.10','>=') + when: docker_upgrade_nuke_images is not defined and curr_docker_version.stdout | version_compare('1.10','<') and docker_version | version_compare('1.10','>=') + |