summaryrefslogtreecommitdiffstats
path: root/roles/container_runtime/tasks/docker_sanity.yml
blob: e62cf55053a6859e1aecd7ff733244ff7978fcd1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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', '>=')