docker_sanity.yml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. ---
  2. # Sanity checks to ensure the role will complete and provide helpful error
  3. # messages for common problems.
  4. - name: Error out if Docker pre-installed but too old
  5. fail:
  6. msg: "Docker {{ curr_docker_version.stdout }} is installed, but >= 1.9.1 is required."
  7. when:
  8. - not (curr_docker_version is skipped)
  9. - curr_docker_version.stdout != ''
  10. - curr_docker_version.stdout is version_compare('1.9.1', '<')
  11. - not (docker_version is defined)
  12. - name: Error out if requested Docker is too old
  13. fail:
  14. msg: "Docker {{ docker_version }} requested, but >= 1.9.1 is required."
  15. when:
  16. - docker_version is defined
  17. - docker_version is version_compare('1.9.1', '<')
  18. # If a docker_version was requested, sanity check that we can install or upgrade to it, and
  19. # no downgrade is required.
  20. - name: Fail if Docker version requested but downgrade is required
  21. fail:
  22. msg: "Docker {{ curr_docker_version.stdout }} is installed, but version {{ docker_version }} was requested."
  23. when:
  24. - not (curr_docker_version is skipped)
  25. - curr_docker_version.stdout != ''
  26. - docker_version is defined
  27. - curr_docker_version.stdout is version_compare(docker_version, '>')
  28. # This involves an extremely slow migration process, users should instead run the
  29. # Docker 1.10 upgrade playbook to accomplish this.
  30. - name: Error out if attempting to upgrade Docker across the 1.10 boundary
  31. fail:
  32. msg: "Cannot upgrade Docker to >= 1.10, please upgrade or remove Docker manually, or use the Docker upgrade playbook if OpenShift is already installed."
  33. when:
  34. - not (curr_docker_version is skipped)
  35. - curr_docker_version.stdout != ''
  36. - curr_docker_version.stdout is version_compare('1.10', '<')
  37. - docker_version is defined
  38. - docker_version is version_compare('1.10', '>=')