main.yml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. ---
  2. - fail:
  3. msg: Flannel can not be used with openshift sdn
  4. when: openshift_use_openshift_sdn | default(false) | bool and openshift_use_flannel | default(false) | bool
  5. - fail:
  6. msg: Nuage sdn can not be used with openshift sdn
  7. when: openshift_use_openshift_sdn | default(false) | 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: openshift_hostname must be 64 characters or less
  13. when: openshift_hostname is defined and openshift_hostname | length > 64
  14. - name: Set common Cluster facts
  15. openshift_facts:
  16. role: common
  17. local_facts:
  18. debug_level: "{{ openshift_debug_level | default(2) }}"
  19. install_examples: "{{ openshift_install_examples | default(True) }}"
  20. use_openshift_sdn: "{{ openshift_use_openshift_sdn | default(None) }}"
  21. sdn_network_plugin_name: "{{ os_sdn_network_plugin_name | default(None) }}"
  22. use_flannel: "{{ openshift_use_flannel | default(None) }}"
  23. use_nuage: "{{ openshift_use_nuage | default(None) }}"
  24. use_manageiq: "{{ openshift_use_manageiq | default(None) }}"
  25. data_dir: "{{ openshift_data_dir | default(None) }}"
  26. # Using oo_image_tag_to_rpm_version here is a workaround for how
  27. # openshift_version is set. That value is computed based on either RPM
  28. # versions or image tags. openshift_common's usage requires that it be a RPM
  29. # version and openshift_cli expects it to be an image tag.
  30. - name: Install the base package for versioning
  31. action: "{{ ansible_pkg_mgr }} name={{ openshift.common.service_type }}{{ openshift_version | default('') | oo_image_tag_to_rpm_version }} state=present"
  32. when: not openshift.common.is_containerized | bool
  33. # This invocation also updates the version facts which are necessary
  34. # for setting the hostname below.
  35. - name: openshift_facts
  36. openshift_facts:
  37. role: hosted
  38. openshift_env: "{{ hostvars[inventory_hostname] | oo_openshift_env }}"
  39. # For enterprise versions < 3.1 and origin versions < 1.1 we want to set the
  40. # hostname by default.
  41. - set_fact:
  42. set_hostname_default: "{{ not openshift.common.version_gte_3_1_or_1_1 }}"
  43. - name: Set hostname
  44. command: >
  45. hostnamectl set-hostname {{ openshift.common.hostname }}
  46. when: openshift_set_hostname | default(set_hostname_default) | bool