main.yml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. shell: ls /run/ostree-booted
  8. ignore_errors: yes
  9. failed_when: false
  10. changed_when: false
  11. register: ostree_output
  12. # Locally setup containerized facts for now
  13. - set_fact:
  14. l_is_atomic: "{{ ostree_output.rc == 0 }}"
  15. - set_fact:
  16. l_is_containerized: "{{ (l_is_atomic | bool) or (containerized | default(false) | bool) }}"
  17. - name: Ensure PyYaml is installed
  18. action: "{{ ansible_pkg_mgr }} name=PyYAML state=present"
  19. when: not l_is_atomic | bool
  20. - name: Gather Cluster facts and set is_containerized if needed
  21. openshift_facts:
  22. role: common
  23. local_facts:
  24. # TODO: Deprecate deployment_type in favor of openshift_deployment_type
  25. deployment_type: "{{ openshift_deployment_type | default(deployment_type) }}"
  26. cluster_id: "{{ openshift_cluster_id | default('default') }}"
  27. hostname: "{{ openshift_hostname | default(None) }}"
  28. ip: "{{ openshift_ip | default(None) }}"
  29. is_containerized: "{{ l_is_containerized | default(None) }}"
  30. public_hostname: "{{ openshift_public_hostname | default(None) }}"
  31. public_ip: "{{ openshift_public_ip | default(None) }}"
  32. portal_net: "{{ openshift_portal_net | default(openshift_master_portal_net) | default(None) }}"
  33. # had to be done outside of the above because hostname isn't yet set
  34. - name: Gather hostnames for proxy configuration
  35. openshift_facts:
  36. role: common
  37. local_facts:
  38. http_proxy: "{{ openshift_http_proxy | default(None) }}"
  39. https_proxy: "{{ openshift_https_proxy | default(None) }}"
  40. no_proxy: "{{ openshift_no_proxy | default(None) }}"
  41. generate_no_proxy_hosts: "{{ openshift_generate_no_proxy_hosts | default(True) }}"
  42. no_proxy_internal_hostnames: "{{ hostvars | oo_select_keys(groups['oo_nodes_to_config']
  43. | union(groups['oo_masters_to_config'])
  44. | union(groups['oo_etcd_to_config'] | default([])))
  45. | oo_collect('openshift.common.hostname') | default([]) | join (',')
  46. }}"