main.yml 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. ---
  2. - name: Verify Ansible version is greater than or equal to 1.9.4 and less than 2.0
  3. fail:
  4. msg: "Unsupported ansible version: {{ ansible_version }} found"
  5. when: ansible_version.full | version_compare('1.9.4', 'lt') or ansible_version.full | version_compare('2.0', 'ge')
  6. - name: Detecting Operating System
  7. stat:
  8. path: /run/ostree-booted
  9. register: ostree_booted
  10. # Locally setup containerized facts for now
  11. - set_fact:
  12. l_is_atomic: "{{ ostree_booted.stat.exists }}"
  13. - set_fact:
  14. l_is_containerized: "{{ (l_is_atomic | bool) or (containerized | default(false) | bool) }}"
  15. - name: Ensure PyYaml is installed
  16. action: "{{ ansible_pkg_mgr }} name=PyYAML state=present"
  17. when: not l_is_atomic | bool
  18. - name: Gather Cluster facts and set is_containerized if needed
  19. openshift_facts:
  20. role: common
  21. local_facts:
  22. # TODO: Deprecate deployment_type in favor of openshift_deployment_type
  23. deployment_type: "{{ openshift_deployment_type | default(deployment_type) }}"
  24. cluster_id: "{{ openshift_cluster_id | default('default') }}"
  25. hostname: "{{ openshift_hostname | default(None) }}"
  26. ip: "{{ openshift_ip | default(None) }}"
  27. is_containerized: "{{ l_is_containerized | default(None) }}"
  28. public_hostname: "{{ openshift_public_hostname | default(None) }}"
  29. public_ip: "{{ openshift_public_ip | default(None) }}"
  30. portal_net: "{{ openshift_portal_net | default(openshift_master_portal_net) | default(None) }}"
  31. # had to be done outside of the above because hostname isn't yet set
  32. - name: Gather hostnames for proxy configuration
  33. openshift_facts:
  34. role: common
  35. local_facts:
  36. http_proxy: "{{ openshift_http_proxy | default(None) }}"
  37. https_proxy: "{{ openshift_https_proxy | default(None) }}"
  38. no_proxy: "{{ openshift_no_proxy | default(None) }}"
  39. generate_no_proxy_hosts: "{{ openshift_generate_no_proxy_hosts | default(True) }}"
  40. no_proxy_internal_hostnames: "{{ hostvars | oo_select_keys(groups['oo_nodes_to_config']
  41. | union(groups['oo_masters_to_config'])
  42. | union(groups['oo_etcd_to_config'] | default([])))
  43. | oo_collect('openshift.common.hostname') | default([]) | join (',')
  44. }}"