main.yml 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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: openshift_hostname must be 64 characters or less
  22. when: openshift_hostname is defined and openshift_hostname | length > 64
  23. - name: Set common Cluster facts
  24. openshift_facts:
  25. role: common
  26. local_facts:
  27. install_examples: "{{ openshift_install_examples | default(True) }}"
  28. use_openshift_sdn: "{{ openshift_use_openshift_sdn | default(None) }}"
  29. sdn_network_plugin_name: "{{ os_sdn_network_plugin_name | default(None) }}"
  30. use_flannel: "{{ openshift_use_flannel | default(None) }}"
  31. use_nuage: "{{ openshift_use_nuage | default(None) }}"
  32. use_contiv: "{{ openshift_use_contiv | default(None) }}"
  33. use_manageiq: "{{ openshift_use_manageiq | default(None) }}"
  34. data_dir: "{{ openshift_data_dir | default(None) }}"
  35. use_dnsmasq: "{{ openshift_use_dnsmasq | default(None) }}"
  36. - name: Install the base package for versioning
  37. package:
  38. name: "{{ openshift.common.service_type }}{{ openshift_pkg_version | default('') | oo_image_tag_to_rpm_version(include_dash=True) }}"
  39. state: present
  40. when: not openshift.common.is_containerized | bool
  41. - name: Set version facts
  42. openshift_facts:
  43. # For enterprise versions < 3.1 and origin versions < 1.1 we want to set the
  44. # hostname by default.
  45. - set_fact:
  46. set_hostname_default: "{{ not openshift.common.version_gte_3_1_or_1_1 }}"
  47. - name: Set hostname
  48. command: >
  49. hostnamectl set-hostname {{ openshift.common.hostname }}
  50. when: openshift_set_hostname | default(set_hostname_default) | bool