main.yml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. ---
  2. # We should print out deprecations prior to any failures so that if a play does fail for other reasons
  3. # the user would also be aware of any deprecated variables they should note to adjust
  4. - include: deprecations.yml
  5. - name: Abort when conflicting deployment type variables are set
  6. when:
  7. - deployment_type is defined
  8. - openshift_deployment_type is defined
  9. - openshift_deployment_type != deployment_type
  10. fail:
  11. msg: |-
  12. openshift_deployment_type is set to "{{ openshift_deployment_type }}".
  13. deployment_type is set to "{{ deployment_type }}".
  14. To avoid unexpected results, this conflict is not allowed.
  15. deployment_type is deprecated in favor of openshift_deployment_type.
  16. Please specify only openshift_deployment_type, or make both the same.
  17. - name: Standardize on latest variable names
  18. set_fact:
  19. # goal is to deprecate deployment_type in favor of openshift_deployment_type.
  20. # both will be accepted for now, but code should refer to the new name.
  21. # TODO: once this is well-documented, add deprecation notice if using old name.
  22. deployment_type: "{{ openshift_deployment_type | default(deployment_type) | default | string }}"
  23. openshift_deployment_type: "{{ openshift_deployment_type | default(deployment_type) | default | string }}"
  24. - name: Abort when deployment type is invalid
  25. # this variable is required; complain early and clearly if it is invalid.
  26. when: openshift_deployment_type not in known_openshift_deployment_types
  27. fail:
  28. msg: |-
  29. Please set openshift_deployment_type to one of:
  30. {{ known_openshift_deployment_types | join(', ') }}
  31. - name: Normalize openshift_release
  32. set_fact:
  33. # Normalize release if provided, e.g. "v3.5" => "3.5"
  34. # Currently this is not required to be defined for all installs, and the
  35. # `openshift_version` role can generally figure out the specific version
  36. # that gets installed (e.g. 3.5.0.1). So consider this the user's expressed
  37. # intent (if any), not the authoritative version that will be installed.
  38. openshift_release: "{{ openshift_release | string | regex_replace('^v', '') }}"
  39. when: openshift_release is defined
  40. - name: Abort when openshift_release is invalid
  41. when:
  42. - openshift_release is defined
  43. - not openshift_release | match('\d+(\.\d+){1,3}$')
  44. fail:
  45. msg: |-
  46. openshift_release is "{{ openshift_release }}" which is not a valid version string.
  47. Please set it to a version string like "3.4".
  48. - include: unsupported.yml
  49. when:
  50. - not openshift_enable_unsupported_configurations | default(false) | bool
  51. - name: Ensure clusterid is set along with the cloudprovider
  52. fail:
  53. msg: >
  54. Ensure that the openshift_clusterid is set and that all infrastructure has the required tags.
  55. For dynamic provisioning when using multiple clusters in different zones, tag each node with Key=kubernetes.io/cluster/xxxx,Value=clusterid where xxxx and clusterid are unique per cluster. In versions prior to 3.6, this was Key=KubernetesCluster,Value=clusterid.
  56. https://github.com/openshift/openshift-docs/blob/master/install_config/persistent_storage/dynamically_provisioning_pvs.adoc#available-dynamically-provisioned-plug-ins
  57. when:
  58. - openshift_clusterid is not defined
  59. - openshift_cloudprovider_kind is defined
  60. - openshift_cloudprovider_kind == 'aws'