basic_facts.yml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. ---
  2. - name: Ensure that all non-node hosts are accessible
  3. hosts: oo_masters_to_config:oo_etcd_to_config:oo_lb_to_config:oo_nfs_to_config
  4. any_errors_fatal: true
  5. tasks:
  6. - name: Initialize basic host facts
  7. # l_init_fact_hosts is passed in via play during control-plane-only
  8. # upgrades and scale-up plays; otherwise oo_all_hosts is used.
  9. hosts: "{{ l_init_fact_hosts | default('oo_all_hosts') }}"
  10. roles:
  11. - role: openshift_facts
  12. tasks:
  13. # TODO: Should this role be refactored into health_checks??
  14. - name: Run openshift_sanitize_inventory to set variables
  15. import_role:
  16. name: openshift_sanitize_inventory
  17. - name: Detecting Operating System from ostree_booted
  18. stat:
  19. path: /run/ostree-booted
  20. get_checksum: false
  21. get_attributes: false
  22. get_mime: false
  23. register: ostree_booted
  24. # TODO(michaelgugino) remove this line once CI is updated.
  25. - name: set openshift_deployment_type if unset
  26. set_fact:
  27. openshift_deployment_type: "{{ deployment_type }}"
  28. when:
  29. - openshift_deployment_type is undefined
  30. - deployment_type is defined
  31. - name: Retrieve existing master configs and validate
  32. hosts: oo_masters_to_config
  33. gather_facts: no
  34. any_errors_fatal: true
  35. roles:
  36. - openshift_facts
  37. tasks:
  38. - import_role:
  39. name: openshift_control_plane
  40. tasks_from: check_existing_config.yml
  41. - when:
  42. - l_existing_config_master_config is defined
  43. - l_existing_config_master_config.networkConfig is defined
  44. block:
  45. - set_fact:
  46. openshift_portal_net: "{{ l_existing_config_master_config.networkConfig.serviceNetworkCIDR }}"
  47. - set_fact:
  48. osm_cluster_network_cidr: "{{ l_existing_config_master_config.networkConfig.clusterNetworks[0].cidr }}"
  49. osm_host_subnet_length: "{{ l_existing_config_master_config.networkConfig.clusterNetworks[0].hostSubnetLength }}"
  50. when:
  51. - l_existing_config_master_config.networkConfig.clusterNetworks is defined
  52. # End block
  53. - name: Initialize special first-master variables
  54. hosts: oo_first_master
  55. roles:
  56. - role: openshift_facts
  57. tasks:
  58. - when: not (osm_default_node_selector is defined)
  59. block:
  60. - set_fact:
  61. # l_existing_config_master_config is set in openshift_control_plane/tasks/check_existing_config.yml
  62. openshift_master_config_node_selector: "{{ l_existing_config_master_config.projectConfig.defaultNodeSelector }}"
  63. when:
  64. - l_existing_config_master_config is defined
  65. - l_existing_config_master_config.projectConfig is defined
  66. - l_existing_config_master_config.projectConfig.defaultNodeSelector is defined
  67. - l_existing_config_master_config.projectConfig.defaultNodeSelector != ''
  68. - set_fact:
  69. # We need to setup openshift_client_binary here for special uses of delegate_to in
  70. # later roles and plays.
  71. first_master_client_binary: "{{ openshift_client_binary }}"
  72. #Some roles may require this to be set for first master
  73. openshift_client_binary: "{{ openshift_client_binary }}"
  74. # we need to know if a default node selector has been manually set outside the installer
  75. l_osm_default_node_selector: '{{ osm_default_node_selector | default(openshift_master_config_node_selector) | default("node-role.kubernetes.io/compute=true") }}'
  76. - name: Disable web console if required
  77. hosts: oo_masters_to_config
  78. gather_facts: no
  79. tasks:
  80. - set_fact:
  81. openshift_web_console_install: False
  82. when:
  83. - openshift_deployment_subtype is defined
  84. - openshift_deployment_subtype == 'registry' or ( osm_disabled_features is defined and 'WebConsole' in osm_disabled_features )