diff options
author | Michael Gugino <mgugino@redhat.com> | 2017-12-05 15:14:49 -0500 |
---|---|---|
committer | Michael Gugino <mgugino@redhat.com> | 2017-12-07 09:25:31 -0500 |
commit | 2249ba3d08d1e6c55bf008609c9e4eace16bd917 (patch) | |
tree | 849e51214d2bd93e3fe8f9f4537d8f843416d4d8 /roles/container_runtime/tasks/docker_sanity.yml | |
parent | 4bcb53654635de775c60d0176e3aeeed4856fc86 (diff) | |
download | openshift-2249ba3d08d1e6c55bf008609c9e4eace16bd917.tar.gz openshift-2249ba3d08d1e6c55bf008609c9e4eace16bd917.tar.bz2 openshift-2249ba3d08d1e6c55bf008609c9e4eace16bd917.tar.xz openshift-2249ba3d08d1e6c55bf008609c9e4eace16bd917.zip |
Implement container_runtime playbooks and changes
This commit refactors some duplicate code, removes
usage of set_fact where not needed, and reorganizes
container_runtime role to use include_role.
Diffstat (limited to 'roles/container_runtime/tasks/docker_sanity.yml')
-rw-r--r-- | roles/container_runtime/tasks/docker_sanity.yml | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/roles/container_runtime/tasks/docker_sanity.yml b/roles/container_runtime/tasks/docker_sanity.yml new file mode 100644 index 000000000..e62cf5505 --- /dev/null +++ b/roles/container_runtime/tasks/docker_sanity.yml @@ -0,0 +1,27 @@ +--- +# Sanity checks to ensure the role will complete and provide helpful error +# messages for common problems. + +- 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', '<') + +# If a docker_version was requested, sanity check that we can install or upgrade to it, and +# no downgrade is required. +- 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 != '' and docker_version is defined 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 upgrade or remove Docker manually, or use the Docker upgrade playbook if OpenShift is already installed." + when: not curr_docker_version | skipped and curr_docker_version.stdout != '' and curr_docker_version.stdout | version_compare('1.10', '<') and docker_version is defined and docker_version | version_compare('1.10', '>=') |