config.yml 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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. master_count: "{{ openshift_master_count | default(groups.oo_masters | length) }}"
  68. - name: Inspect state of first master config settings
  69. hosts: oo_first_master
  70. roles:
  71. - role: openshift_facts
  72. tasks:
  73. - import_role:
  74. name: openshift_control_plane
  75. tasks_from: check_existing_config.yml
  76. - name: Configure masters
  77. hosts: oo_masters_to_config
  78. any_errors_fatal: true
  79. vars:
  80. openshift_master_count: "{{ openshift.master.master_count }}"
  81. openshift_ca_host: "{{ groups.oo_first_master.0 }}"
  82. pre_tasks:
  83. - name: Prepare the bootstrap node config on masters for self-hosting
  84. import_role:
  85. name: openshift_node_group
  86. tasks_from: bootstrap
  87. # TODO: move me into a more appropriate location
  88. - name: Update the sysconfig for the masters to give them bootstrap config
  89. lineinfile:
  90. dest: "/etc/sysconfig/{{ openshift_service_type }}-node"
  91. line: "{{ item.line | default(omit) }}"
  92. regexp: "{{ item.regexp }}"
  93. state: "{{ item.state | default('present') }}"
  94. with_items:
  95. - line: "BOOTSTRAP_CONFIG_NAME={{ openshift_node_group_master | default('node-config-master') }}"
  96. regexp: "^BOOTSTRAP_CONFIG_NAME=.*"
  97. roles:
  98. - role: openshift_master_facts
  99. - role: openshift_clock
  100. - role: openshift_cloud_provider
  101. when: openshift_cloudprovider_kind is defined
  102. - role: openshift_builddefaults
  103. - role: openshift_buildoverrides
  104. - role: nickhammond.logrotate
  105. - role: openshift_control_plane
  106. - role: tuned
  107. - role: nuage_ca
  108. when: openshift_use_nuage | default(false) | bool
  109. - role: nuage_common
  110. when: openshift_use_nuage | default(false) | bool
  111. - role: nuage_master
  112. when: openshift_use_nuage | default(false) | bool
  113. - role: calico_master
  114. when: openshift_use_calico | default(false) | bool
  115. tasks:
  116. - name: Set up automatic node config reconcilation
  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. include_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: Re-enable excluder if it was previously enabled
  131. hosts: oo_masters_to_config
  132. gather_facts: no
  133. roles:
  134. - role: openshift_excluder
  135. r_openshift_excluder_action: enable
  136. - name: Master Install Checkpoint End
  137. hosts: all
  138. gather_facts: false
  139. tasks:
  140. - name: Set Master install 'Complete'
  141. run_once: true
  142. set_stats:
  143. data:
  144. installer_phase_master:
  145. status: "Complete"
  146. end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"