main.yml 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. # had to be done outside of the above because hostname isn't yet set
  33. - name: Gather hostnames for proxy configuration
  34. openshift_facts:
  35. role: common
  36. local_facts:
  37. http_proxy: "{{ openshift_http_proxy | default(None) }}"
  38. https_proxy: "{{ openshift_https_proxy | default(None) }}"
  39. no_proxy: "{{ openshift_no_proxy | default(None) }}"
  40. generate_no_proxy_hosts: "{{ openshift_generate_no_proxy_hosts | default(True) }}"
  41. no_proxy_internal_hostnames: "{{ hostvars | oo_select_keys(groups['oo_nodes_to_config']
  42. | union(groups['oo_masters_to_config'])
  43. | union(groups['oo_etcd_to_config'] | default([])))
  44. | oo_collect('openshift.common.hostname') | default([]) | join (',')
  45. }}"