main.yml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435
  1. ---
  2. - name: Standardize on latest variable names
  3. set_fact:
  4. # goal is to deprecate deployment_type in favor of openshift_deployment_type.
  5. # both will be accepted for now, but code should refer to the new name.
  6. # TODO: once this is well-documented, add deprecation notice if using old name.
  7. deployment_type: "{{ openshift_deployment_type | default(deployment_type) | default | string }}"
  8. openshift_deployment_type: "{{ openshift_deployment_type | default(deployment_type) | default | string }}"
  9. - name: Abort when deployment type is invalid
  10. # this variable is required; complain early and clearly if it is invalid.
  11. when: openshift_deployment_type not in known_openshift_deployment_types
  12. fail:
  13. msg: |-
  14. Please set openshift_deployment_type to one of:
  15. {{ known_openshift_deployment_types | join(', ') }}
  16. - name: Normalize openshift_release
  17. set_fact:
  18. # Normalize release if provided, e.g. "v3.5" => "3.5"
  19. # Currently this is not required to be defined for all installs, and the
  20. # `openshift_version` role can generally figure out the specific version
  21. # that gets installed (e.g. 3.5.0.1). So consider this the user's expressed
  22. # intent (if any), not the authoritative version that will be installed.
  23. openshift_release: "{{ openshift_release | string | regex_replace('^v', '') }}"
  24. when: openshift_release is defined
  25. - name: Abort when openshift_release is invalid
  26. when:
  27. - openshift_release is defined
  28. - not openshift_release | match('\d+(\.\d+){1,3}$')
  29. fail:
  30. msg: |-
  31. openshift_release is "{{ openshift_release }}" which is not a valid version string.
  32. Please set it to a version string like "3.4".