main.yml 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. ---
  2. - block:
  3. - name: Detecting Operating System
  4. stat:
  5. path: /run/ostree-booted
  6. register: ostree_booted
  7. # Locally setup containerized facts for now
  8. - set_fact:
  9. l_is_atomic: "{{ ostree_booted.stat.exists }}"
  10. - set_fact:
  11. l_is_containerized: "{{ (l_is_atomic | bool) or (containerized | default(false) | bool) }}"
  12. l_is_openvswitch_system_container: "{{ (use_openvswitch_system_container | default(use_system_containers) | bool) }}"
  13. l_is_node_system_container: "{{ (use_node_system_container | default(use_system_containers) | bool) }}"
  14. l_is_master_system_container: "{{ (use_master_system_container | default(use_system_containers) | bool) }}"
  15. l_is_etcd_system_container: "{{ (use_etcd_system_container | default(use_system_containers) | bool) }}"
  16. - name: Ensure various deps are installed
  17. package: name={{ item }} state=present
  18. with_items: "{{ required_packages }}"
  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. debug_level: "{{ openshift_debug_level | default(2) }}"
  25. # TODO: Deprecate deployment_type in favor of openshift_deployment_type
  26. deployment_type: "{{ openshift_deployment_type | default(deployment_type) }}"
  27. deployment_subtype: "{{ openshift_deployment_subtype | default(None) }}"
  28. cluster_id: "{{ openshift_cluster_id | default('default') }}"
  29. hostname: "{{ openshift_hostname | default(None) }}"
  30. ip: "{{ openshift_ip | default(None) }}"
  31. is_containerized: "{{ l_is_containerized | default(None) }}"
  32. is_openvswitch_system_container: "{{ l_is_openvswitch_system_container | default(false) }}"
  33. is_node_system_container: "{{ l_is_node_system_container | default(false) }}"
  34. is_master_system_container: "{{ l_is_master_system_container | default(false) }}"
  35. is_etcd_system_container: "{{ l_is_etcd_system_container | default(false) }}"
  36. system_images_registry: "{{ system_images_registry | default('') }}"
  37. public_hostname: "{{ openshift_public_hostname | default(None) }}"
  38. public_ip: "{{ openshift_public_ip | default(None) }}"
  39. portal_net: "{{ openshift_portal_net | default(openshift_master_portal_net) | default(None) }}"
  40. http_proxy: "{{ openshift_http_proxy | default(None) }}"
  41. https_proxy: "{{ openshift_https_proxy | default(None) }}"
  42. no_proxy: "{{ openshift_no_proxy | default(None) }}"
  43. generate_no_proxy_hosts: "{{ openshift_generate_no_proxy_hosts | default(True) }}"
  44. no_proxy_internal_hostnames: "{{ openshift_no_proxy_internal_hostnames | default(None) }}"
  45. sdn_network_plugin_name: "{{ os_sdn_network_plugin_name | default(None) }}"
  46. use_openshift_sdn: "{{ openshift_use_openshift_sdn | default(None) }}"
  47. - name: Set repoquery command
  48. set_fact:
  49. repoquery_cmd: "{{ 'dnf repoquery --latest-limit 1 -d 0' if ansible_pkg_mgr == 'dnf' else 'repoquery --plugins' }}"
  50. # This `when` allows us to skip this expensive block of tasks on
  51. # subsequent calls to the `openshift_facts` role. You will notice
  52. # speed-ups in proportion to the size of your cluster as this will
  53. # skip all tasks on the next calls to the `openshift_facts` role.
  54. when:
  55. - openshift_facts_init is not defined
  56. - name: Record that openshift_facts has initialized
  57. set_fact:
  58. openshift_facts_init: true