summaryrefslogtreecommitdiffstats
path: root/roles/container_runtime/tasks/docker_sanity.yml
blob: bc4da1ccea417bc095ec3a7c4c1b3f5b6d11f08d (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
---
# 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 is skipped)
  - curr_docker_version.stdout != ''
  - curr_docker_version.stdout is version_compare('1.9.1', '<')
  - 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
  - docker_version is 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 is skipped)
  - curr_docker_version.stdout != ''
  - docker_version is defined
  - curr_docker_version.stdout is 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 is skipped)
  - curr_docker_version.stdout != ''
  - curr_docker_version.stdout is version_compare('1.10', '<')
  - docker_version is defined
  - docker_version is version_compare('1.10', '>=')