diff options
author | Devan Goodwin <dgoodwin@redhat.com> | 2016-07-13 11:56:17 -0300 |
---|---|---|
committer | Devan Goodwin <dgoodwin@redhat.com> | 2016-07-13 11:56:17 -0300 |
commit | af2c6f8fee050173b846221371c34538f4dc8f79 (patch) | |
tree | ca52ed364518d3c054b8eadaeeea15ec9cdafca7 /roles/docker | |
parent | db8b2513071c367e0f67203feabede25545a6d97 (diff) | |
download | openshift-af2c6f8fee050173b846221371c34538f4dc8f79.tar.gz openshift-af2c6f8fee050173b846221371c34538f4dc8f79.tar.bz2 openshift-af2c6f8fee050173b846221371c34538f4dc8f79.tar.xz openshift-af2c6f8fee050173b846221371c34538f4dc8f79.zip |
Add checks to docker role for 1.9.1+.
If Docker 1.8.2 is pre-installed, and no docker_version was requested,
role will now error out because 1.9.1 is required.
If docker_version is set to <= 1.9.1, we also error out as this is not
supported.
Diffstat (limited to 'roles/docker')
-rw-r--r-- | roles/docker/tasks/main.yml | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/roles/docker/tasks/main.yml b/roles/docker/tasks/main.yml index ac065ea51..8b6ce7eae 100644 --- a/roles/docker/tasks/main.yml +++ b/roles/docker/tasks/main.yml @@ -4,10 +4,20 @@ - name: Get current installed Docker version command: "{{ repoquery_cmd }} --installed --qf '%{version}' docker" - when: docker_version is defined and not openshift.common.is_atomic | bool + when: not openshift.common.is_atomic | bool register: curr_docker_version changed_when: false +- name: Error out if Docker pre-installed but too old + fail: + msg: "Docker {{ curr_docker_version.stdout }} is installed, but >= 1.9.1 is required." + when: not curr_docker_version | skipped and curr_docker_version.stdout != '' and curr_docker_version.stdout | version_compare('1.9.1', '<') and not docker_version is defined + +- name: Error out if requested Docker is too old + fail: + msg: "Docker {{ docker_version }} requested, but >= 1.9.1 is required." + when: docker_version is defined and docker_version | version_compare('1.9.1', '<') + - name: Get latest available version of Docker command: > {{ repoquery_cmd }} --qf '%{version}' "docker" @@ -21,14 +31,14 @@ - name: Fail if Docker version requested but downgrade is required fail: msg: "Docker {{ curr_docker_version.stdout }} is installed, but version {{ docker_version }} was requested." - when: not curr_docker_version | skipped and curr_docker_version.stdout | default('0.0', True) | version_compare(docker_version, '>') + when: not curr_docker_version | skipped and curr_docker_version.stdout != '' and curr_docker_version.stdout | version_compare(docker_version, '>') # This involves an extremely slow migration process, users should instead run the # Docker 1.10 upgrade playbook to accomplish this. - name: Error out if attempting to upgrade Docker across the 1.10 boundary fail: msg: "Cannot upgrade Docker to >= 1.10, please use the Docker upgrade playbook for this." - when: not curr_docker_version | skipped and curr_docker_version.stdout | default('0.0', True) | version_compare('1.10', '<') and docker_version | version_compare('1.10', '>=') + when: not curr_docker_version | skipped and curr_docker_version.stdout != '' and curr_docker_version.stdout | version_compare('1.10', '<') and docker_version | version_compare('1.10', '>=') # Make sure Docker is installed, but does not update a running version. # Docker upgrades are handled by a separate playbook. |