config.yml 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  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. - name: Inspect state of first master config settings
  68. hosts: oo_first_master
  69. roles:
  70. - role: openshift_facts
  71. tasks:
  72. - import_role:
  73. name: openshift_control_plane
  74. tasks_from: check_existing_config.yml
  75. - name: Configure masters
  76. hosts: oo_masters_to_config
  77. any_errors_fatal: true
  78. vars:
  79. openshift_ca_host: "{{ groups.oo_first_master.0 }}"
  80. pre_tasks:
  81. - name: Prepare the bootstrap node config on masters for self-hosting
  82. import_role:
  83. name: openshift_node_group
  84. tasks_from: bootstrap
  85. - name: Have the masters automatically pull their configuration
  86. import_role:
  87. name: openshift_node_group
  88. tasks_from: bootstrap_config
  89. vars:
  90. r_node_bootstrap_config_name: "{{ openshift_node_group_master | default('node-config-master') }}"
  91. roles:
  92. - role: openshift_master_facts
  93. - role: openshift_clock
  94. - role: openshift_cloud_provider
  95. when: openshift_cloudprovider_kind is defined
  96. - role: openshift_builddefaults
  97. - role: openshift_buildoverrides
  98. - role: nickhammond.logrotate
  99. - role: openshift_control_plane
  100. - role: tuned
  101. - role: nuage_ca
  102. when: openshift_use_nuage | default(false) | bool
  103. - role: nuage_common
  104. when: openshift_use_nuage | default(false) | bool
  105. - role: nuage_master
  106. when: openshift_use_nuage | default(false) | bool
  107. - role: calico_master
  108. when: openshift_use_calico | default(false) | bool
  109. tasks:
  110. - name: Set up automatic node config reconcilation
  111. import_role:
  112. name: openshift_node_group
  113. tasks_from: sync
  114. - import_role:
  115. name: kuryr
  116. tasks_from: master
  117. when: openshift_use_kuryr | default(false) | bool
  118. - name: setup bootstrap settings
  119. import_tasks: tasks/enable_bootstrap.yml
  120. post_tasks:
  121. - name: Create group for deployment type
  122. group_by: key=oo_masters_deployment_type_{{ openshift_deployment_type }}
  123. changed_when: False
  124. - name: Re-enable excluder if it was previously enabled
  125. hosts: oo_masters_to_config
  126. gather_facts: no
  127. roles:
  128. - role: openshift_excluder
  129. r_openshift_excluder_action: enable
  130. - name: Master Install Checkpoint End
  131. hosts: all
  132. gather_facts: false
  133. tasks:
  134. - name: Set Master install 'Complete'
  135. run_once: true
  136. set_stats:
  137. data:
  138. installer_phase_master:
  139. status: "Complete"
  140. end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"