main.yml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. cluster_id: "{{ openshift_cluster_id | default('default') }}"
  19. debug_level: "{{ openshift_debug_level | default(2) }}"
  20. hostname: "{{ openshift_hostname | default(None) }}"
  21. install_examples: "{{ openshift_install_examples | default(True) }}"
  22. ip: "{{ openshift_ip | default(None) }}"
  23. public_hostname: "{{ openshift_public_hostname | default(None) }}"
  24. public_ip: "{{ openshift_public_ip | default(None) }}"
  25. use_openshift_sdn: "{{ openshift_use_openshift_sdn | default(None) }}"
  26. sdn_network_plugin_name: "{{ os_sdn_network_plugin_name | default(None) }}"
  27. deployment_type: "{{ openshift_deployment_type }}"
  28. use_fluentd: "{{ openshift_use_fluentd | default(None) }}"
  29. use_flannel: "{{ openshift_use_flannel | default(None) }}"
  30. use_nuage: "{{ openshift_use_nuage | default(None) }}"
  31. use_manageiq: "{{ openshift_use_manageiq | default(None) }}"
  32. data_dir: "{{ openshift_data_dir | default(None) }}"
  33. - name: Install the base package for versioning
  34. action: "{{ ansible_pkg_mgr }} name={{ openshift.common.service_type }}{{ openshift_version | default('') }} state=present"
  35. when: not openshift.common.is_containerized | bool
  36. # This invocation also updates the version facts which are necessary
  37. # for setting the hostname below.
  38. - name: openshift_facts
  39. openshift_facts:
  40. role: hosted
  41. openshift_env: "{{ hostvars[inventory_hostname] | oo_openshift_env }}"
  42. # For enterprise versions < 3.1 and origin versions < 1.1 we want to set the
  43. # hostname by default.
  44. - set_fact:
  45. set_hostname_default: "{{ not openshift.common.version_greater_than_3_1_or_1_1 }}"
  46. - name: Set hostname
  47. command: >
  48. hostnamectl set-hostname {{ openshift.common.hostname }}
  49. when: openshift_set_hostname | default(set_hostname_default) | bool