main.yml 3.4 KB

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