config.yml 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. ---
  2. - name: Master Install Checkpoint Start
  3. hosts: all
  4. gather_facts: false
  5. tasks:
  6. - name: Set Master install 'In Progress'
  7. run_once: true
  8. set_stats:
  9. data:
  10. installer_phase_master:
  11. status: "In Progress"
  12. start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
  13. - import_playbook: certificates.yml
  14. - name: Disable excluders
  15. hosts: oo_masters_to_config
  16. gather_facts: no
  17. roles:
  18. - role: openshift_excluder
  19. r_openshift_excluder_action: disable
  20. - name: Gather and set facts for master hosts
  21. hosts: oo_masters_to_config
  22. pre_tasks:
  23. # Per https://bugzilla.redhat.com/show_bug.cgi?id=1469336
  24. #
  25. # When scaling up a cluster upgraded from OCP <= 3.5, ensure that
  26. # OPENSHIFT_DEFAULT_REGISTRY is present as defined on the existing
  27. # masters, or absent if such is the case.
  28. - name: Detect if this host is a new master in a scale up
  29. set_fact:
  30. g_openshift_master_is_scaleup: "{{ inventory_hostname in ( groups['new_masters'] | default([]) ) }}"
  31. - name: Scaleup Detection
  32. debug:
  33. var: g_openshift_master_is_scaleup
  34. - name: Check for RPM generated config marker file .config_managed
  35. stat:
  36. path: /etc/origin/.config_managed
  37. register: rpmgenerated_config
  38. - name: Remove RPM generated config files if present
  39. file:
  40. path: "/etc/origin/{{ item }}"
  41. state: absent
  42. when:
  43. - rpmgenerated_config.stat.exists == true
  44. - openshift_deployment_type == 'openshift-enterprise'
  45. with_items:
  46. - master
  47. - node
  48. - .config_managed
  49. roles:
  50. - openshift_facts
  51. post_tasks:
  52. - openshift_facts:
  53. role: master
  54. local_facts:
  55. api_port: "{{ openshift_master_api_port | default(None) }}"
  56. api_url: "{{ openshift_master_api_url | default(None) }}"
  57. api_use_ssl: "{{ openshift_master_api_use_ssl | default(None) }}"
  58. controllers_port: "{{ openshift_master_controllers_port | default(None) }}"
  59. public_api_url: "{{ openshift_master_public_api_url | default(None) }}"
  60. cluster_hostname: "{{ openshift_master_cluster_hostname | default(None) }}"
  61. cluster_public_hostname: "{{ openshift_master_cluster_public_hostname | default(None) }}"
  62. console_path: "{{ openshift_master_console_path | default(None) }}"
  63. console_port: "{{ openshift_master_console_port | default(None) }}"
  64. console_url: "{{ openshift_master_console_url | default(None) }}"
  65. console_use_ssl: "{{ openshift_master_console_use_ssl | default(None) }}"
  66. public_console_url: "{{ openshift_master_public_console_url | default(None) }}"
  67. - openshift_facts:
  68. role: node
  69. local_facts:
  70. bootstrapped: true
  71. - name: Inspect state of first master config settings
  72. hosts: oo_first_master
  73. roles:
  74. - role: openshift_facts
  75. tasks:
  76. - import_role:
  77. name: openshift_control_plane
  78. tasks_from: check_existing_config
  79. - name: Configure masters
  80. hosts: oo_masters_to_config
  81. any_errors_fatal: true
  82. vars:
  83. openshift_ca_host: "{{ groups.oo_first_master.0 }}"
  84. pre_tasks:
  85. - name: Prepare the bootstrap node config on masters for self-hosting
  86. import_role:
  87. name: openshift_node_group
  88. tasks_from: bootstrap
  89. - name: Have the masters automatically pull their configuration
  90. import_role:
  91. name: openshift_node_group
  92. tasks_from: bootstrap_config
  93. vars:
  94. r_node_dynamic_config_name: "{{ openshift_node_group_name | default('node-config-master') }}"
  95. r_node_dynamic_config_force: True
  96. roles:
  97. - role: openshift_master_facts
  98. - role: openshift_clock
  99. - role: openshift_cloud_provider
  100. when: openshift_cloudprovider_kind is defined
  101. - role: openshift_builddefaults
  102. - role: openshift_buildoverrides
  103. - role: nickhammond.logrotate
  104. - role: openshift_control_plane
  105. - role: tuned
  106. - role: nuage_ca
  107. when: openshift_use_nuage | default(false) | bool
  108. - role: nuage_common
  109. when: openshift_use_nuage | default(false) | bool
  110. - role: nuage_master
  111. when: openshift_use_nuage | default(false) | bool
  112. - role: calico_master
  113. when: openshift_use_calico | default(false) | bool
  114. tasks:
  115. - name: Set up automatic node config reconcilation
  116. run_once: True
  117. import_role:
  118. name: openshift_node_group
  119. tasks_from: sync
  120. - import_role:
  121. name: kuryr
  122. tasks_from: master
  123. when: openshift_use_kuryr | default(false) | bool
  124. - name: setup bootstrap settings
  125. import_tasks: tasks/enable_bootstrap.yml
  126. post_tasks:
  127. - name: Create group for deployment type
  128. group_by: key=oo_masters_deployment_type_{{ openshift_deployment_type }}
  129. changed_when: False
  130. - name: Deploy the central bootstrap configuration
  131. hosts: oo_first_master
  132. gather_facts: no
  133. tasks:
  134. - name: setup bootstrap settings
  135. import_tasks: tasks/enable_bootstrap_config.yml
  136. - name: Ensure inventory labels are assigned to masters
  137. hosts: oo_masters_to_config
  138. gather_facts: no
  139. roles:
  140. - role: openshift_manage_node
  141. openshift_master_host: "{{ groups.oo_first_master.0 }}"
  142. openshift_manage_node_is_master: "{{ ('oo_masters_to_config' in group_names) | bool }}"
  143. openshift_node_master_api_url: "{{ hostvars[groups.oo_first_master.0].openshift.master.api_url }}"
  144. - name: Re-enable excluder if it was previously enabled
  145. hosts: oo_masters_to_config
  146. gather_facts: no
  147. roles:
  148. - role: openshift_excluder
  149. r_openshift_excluder_action: enable
  150. - name: Master Install Checkpoint End
  151. hosts: all
  152. gather_facts: false
  153. tasks:
  154. - name: Set Master install 'Complete'
  155. run_once: true
  156. set_stats:
  157. data:
  158. installer_phase_master:
  159. status: "Complete"
  160. end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"