first_master.yml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. ---
  2. # Determine the openshift_version to configure if none has been specified or set previously.
  3. # Protect the installed version by default unless explicitly told not to, or given an
  4. # openshift_version already.
  5. - name: Use openshift_current_version fact as version to configure if already installed
  6. set_fact:
  7. openshift_version: "{{ openshift_current_version }}"
  8. when:
  9. - openshift_current_version is defined
  10. - openshift_version is not defined or openshift_version == ""
  11. - openshift_protect_installed_version | bool
  12. - name: Set openshift_version to openshift_release if undefined
  13. set_fact:
  14. openshift_version: "{{ openshift_release }}"
  15. when:
  16. - openshift_version is not defined or openshift_version == ""
  17. - block:
  18. - debug:
  19. msg: "openshift_pkg_version was not defined. Falling back to -{{ openshift_version }}"
  20. - set_fact:
  21. # We append an '*' here because yum is not flexible.
  22. openshift_pkg_version: "-{{ openshift_version }}*"
  23. when:
  24. - openshift_pkg_version is not defined
  25. - block:
  26. - debug:
  27. msg: "openshift_image_tag was not defined. Falling back to v{{ openshift_version }}"
  28. - set_fact:
  29. openshift_image_tag: "v{{ openshift_version }}"
  30. when: openshift_image_tag is not defined
  31. - name: assert openshift_release in openshift_image_tag
  32. assert:
  33. that: openshift_release in openshift_image_tag
  34. msg: >
  35. openshift_image_tag must match same major version as openshift_release.
  36. You provided: {{ openshift_release }} and {{ openshift_image_tag }}
  37. - name: assert openshift_release in openshift_pkg_version
  38. assert:
  39. that: openshift_release in openshift_pkg_version
  40. msg: >
  41. openshift_pkg_version must match same major version as openshift_release.
  42. You provided: {{ openshift_release }} and {{ openshift_pkg_version }}
  43. # The end result of these variables is quite important so make sure they are displayed and logged:
  44. - debug: var=openshift_release
  45. - debug: var=openshift_image_tag
  46. - debug: var=openshift_pkg_version
  47. - debug: var=openshift_version