main.yml 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. ---
  2. - fail:
  3. msg: Flannel can not be used with openshift sdn, set openshift_use_openshift_sdn=false if you want to use flannel
  4. when: openshift_use_openshift_sdn | default(true) | bool and openshift_use_flannel | default(false) | bool
  5. - fail:
  6. msg: Nuage sdn can not be used with openshift sdn, set openshift_use_openshift_sdn=false if you want to use nuage
  7. when: openshift_use_openshift_sdn | default(true) | bool and openshift_use_nuage | default(false) | bool
  8. - fail:
  9. msg: Nuage sdn can not be used with flannel
  10. when: openshift_use_flannel | default(false) | bool and openshift_use_nuage | default(false) | bool
  11. - fail:
  12. msg: Contiv can not be used with openshift sdn, set openshift_use_openshift_sdn=false if you want to use contiv
  13. when: openshift_use_openshift_sdn | default(true) | bool and openshift_use_contiv | default(false) | bool
  14. - fail:
  15. msg: Contiv can not be used with flannel
  16. when: openshift_use_flannel | default(false) | bool and openshift_use_contiv | default(false) | bool
  17. - fail:
  18. msg: Contiv can not be used with nuage
  19. when: openshift_use_nuage | default(false) | bool and openshift_use_contiv | default(false) | bool
  20. - fail:
  21. msg: Calico can not be used with openshift sdn, set openshift_use_openshift_sdn=false if you want to use Calico
  22. when: openshift_use_openshift_sdn | default(true) | bool and openshift_use_calico | default(false) | bool
  23. - fail:
  24. msg: Calico cannot currently be used with Flannel in Openshift. Set either openshift_use_calico or openshift_use_flannel, but not both
  25. when: openshift_use_calico | default(false) | bool and openshift_use_flannel | default(false) | bool
  26. - fail:
  27. msg: openshift_hostname must be 64 characters or less
  28. when: openshift_hostname is defined and openshift_hostname | length > 64
  29. - name: Set common Cluster facts
  30. openshift_facts:
  31. role: common
  32. local_facts:
  33. install_examples: "{{ openshift_install_examples | default(True) }}"
  34. use_openshift_sdn: "{{ openshift_use_openshift_sdn | default(None) }}"
  35. sdn_network_plugin_name: "{{ os_sdn_network_plugin_name | default(None) }}"
  36. use_flannel: "{{ openshift_use_flannel | default(None) }}"
  37. use_calico: "{{openshift_use_calico | default(None) }}"
  38. use_nuage: "{{ openshift_use_nuage | default(None) }}"
  39. use_contiv: "{{ openshift_use_contiv | default(None) }}"
  40. use_manageiq: "{{ openshift_use_manageiq | default(None) }}"
  41. data_dir: "{{ openshift_data_dir | default(None) }}"
  42. use_dnsmasq: "{{ openshift_use_dnsmasq | default(None) }}"
  43. - name: Install the base package for versioning
  44. package:
  45. name: "{{ openshift.common.service_type }}{{ openshift_pkg_version | default('') | oo_image_tag_to_rpm_version(include_dash=True) }}"
  46. state: present
  47. when: not openshift.common.is_containerized | bool
  48. - name: Set version facts
  49. openshift_facts:
  50. # For enterprise versions < 3.1 and origin versions < 1.1 we want to set the
  51. # hostname by default.
  52. - set_fact:
  53. set_hostname_default: "{{ not openshift.common.version_gte_3_1_or_1_1 }}"
  54. - name: Set hostname
  55. command: >
  56. hostnamectl set-hostname {{ openshift.common.hostname }}
  57. when: openshift_set_hostname | default(set_hostname_default) | bool