main.yml 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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_tasks: deprecations.yml
  5. - name: Standardize on latest variable names
  6. set_fact:
  7. deployment_subtype: "{{ openshift_deployment_subtype | default(deployment_subtype) | default('basic') | string }}"
  8. openshift_deployment_subtype: "{{ openshift_deployment_subtype | default(deployment_subtype) | default('basic') | string }}"
  9. - name: Normalize openshift_release
  10. set_fact:
  11. # Normalize release if provided, e.g. "v3.5" => "3.5"
  12. # Currently this is not required to be defined for all installs, and the
  13. # `openshift_version` role can generally figure out the specific version
  14. # that gets installed (e.g. 3.5.0.1). So consider this the user's expressed
  15. # intent (if any), not the authoritative version that will be installed.
  16. openshift_release: "{{ openshift_release | string | regex_replace('^v', '') }}"
  17. when: openshift_release is defined
  18. - name: Abort when openshift_release is invalid
  19. when:
  20. - openshift_release is defined
  21. - not (openshift_release is match('^\d+(\.\d+){1,3}$'))
  22. fail:
  23. msg: |-
  24. openshift_release is "{{ openshift_release }}" which is not a valid version string.
  25. Please set it to a version string like "3.4".
  26. - include_tasks: unsupported.yml
  27. when:
  28. - not openshift_enable_unsupported_configurations | default(false) | bool
  29. - name: Ensure clusterid is set along with the cloudprovider
  30. fail:
  31. msg: >
  32. Ensure that the openshift_clusterid is set and that all infrastructure has the required tags.
  33. 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.
  34. https://github.com/openshift/openshift-docs/blob/master/install_config/persistent_storage/dynamically_provisioning_pvs.adoc#available-dynamically-provisioned-plug-ins
  35. when:
  36. - openshift_clusterid is not defined
  37. - openshift_cloudprovider_kind is defined
  38. - openshift_cloudprovider_kind == 'aws'
  39. - name: Ensure ansible_service_broker_remove and ansible_service_broker_install are mutually exclusive
  40. fail:
  41. msg: >
  42. Ensure ansible_service_broker_remove and ansible_service_broker_install are mutually exclusive,
  43. do not set both to true. ansible_service_broker_install defaults to true.
  44. when:
  45. - ansible_service_broker_remove | default(false) | bool
  46. - ansible_service_broker_install | default(true) | bool
  47. - name: Ensure template_service_broker_remove and template_service_broker_install are mutually exclusive
  48. fail:
  49. msg: >
  50. Ensure that template_service_broker_remove and template_service_broker_install are mutually exclusive,
  51. do not set both to true. template_service_broker_remove defaults to true.
  52. when:
  53. - template_service_broker_remove | default(false) | bool
  54. - template_service_broker_install | default(true) | bool
  55. - name: Ensure that all requires vsphere configuration variables are set
  56. fail:
  57. msg: >
  58. When the vSphere cloud provider is configured you must define all of these variables:
  59. openshift_cloudprovider_vsphere_username, openshift_cloudprovider_vsphere_password,
  60. openshift_cloudprovider_vsphere_host, openshift_cloudprovider_vsphere_datacenter,
  61. openshift_cloudprovider_vsphere_datastore, openshift_cloudprovider_vsphere_folder
  62. when:
  63. - openshift_cloudprovider_kind is defined
  64. - openshift_cloudprovider_kind == 'vsphere'
  65. - ( openshift_cloudprovider_vsphere_username is undefined or openshift_cloudprovider_vsphere_password is undefined or
  66. openshift_cloudprovider_vsphere_host is undefined or openshift_cloudprovider_vsphere_datacenter is undefined or
  67. openshift_cloudprovider_vsphere_datastore is undefined or openshift_cloudprovider_vsphere_folder )