config.yml 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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. title: "Master Install"
  12. playbook: "playbooks/openshift-master/config.yml"
  13. status: "In Progress"
  14. start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
  15. - import_playbook: certificates.yml
  16. - name: Disable excluders and gather facts
  17. hosts: oo_masters_to_config
  18. roles:
  19. - openshift_facts
  20. tasks:
  21. - name: Disable excluders
  22. import_role:
  23. name: openshift_excluder
  24. vars:
  25. r_openshift_excluder_action: disable
  26. - name: Check for RPM generated config marker file .config_managed
  27. stat:
  28. path: /etc/origin/.config_managed
  29. register: rpmgenerated_config
  30. - name: Remove RPM generated config files if present
  31. file:
  32. path: "/etc/origin/{{ item }}"
  33. state: absent
  34. when:
  35. - rpmgenerated_config.stat.exists == true
  36. - openshift_deployment_type == 'openshift-enterprise'
  37. with_items:
  38. - master
  39. - node
  40. - .config_managed
  41. - openshift_facts:
  42. role: master
  43. local_facts:
  44. api_port: "{{ openshift_master_api_port }}"
  45. api_url: "{{ openshift_master_api_url | default(None) }}"
  46. api_use_ssl: "{{ openshift_master_api_use_ssl | default(None) }}"
  47. controllers_port: "{{ openshift_master_controllers_port | default(None) }}"
  48. public_api_url: "{{ openshift_master_public_api_url | default(None) }}"
  49. cluster_hostname: "{{ openshift_master_cluster_hostname | default(None) }}"
  50. cluster_public_hostname: "{{ openshift_master_cluster_public_hostname | default(None) }}"
  51. console_path: "{{ openshift_master_console_path | default(None) }}"
  52. console_port: "{{ openshift_master_console_port | default(None) }}"
  53. console_url: "{{ openshift_master_console_url | default(None) }}"
  54. console_use_ssl: "{{ openshift_master_console_use_ssl | default(None) }}"
  55. public_console_url: "{{ openshift_master_public_console_url | default(None) }}"
  56. - openshift_facts:
  57. role: node
  58. local_facts:
  59. bootstrapped: true
  60. - name: Generate or retrieve existing session secrets
  61. hosts: oo_first_master
  62. roles:
  63. - role: openshift_facts
  64. tasks:
  65. - import_role:
  66. name: openshift_control_plane
  67. tasks_from: generate_session_secrets.yml
  68. - name: Configure masters
  69. hosts: oo_masters_to_config
  70. any_errors_fatal: true
  71. pre_tasks:
  72. - name: Prepare the bootstrap node config on masters for self-hosting
  73. import_role:
  74. name: openshift_node_group
  75. tasks_from: bootstrap
  76. - name: Have the masters automatically pull their configuration
  77. import_role:
  78. name: openshift_node_group
  79. tasks_from: bootstrap_config
  80. vars:
  81. r_node_dynamic_config_name: "{{ openshift_node_group_name | default('node-config-master') }}"
  82. r_node_dynamic_config_force: True
  83. roles:
  84. - role: openshift_master_facts
  85. - role: openshift_cloud_provider
  86. when: openshift_cloudprovider_kind is defined
  87. - role: openshift_builddefaults
  88. - role: openshift_buildoverrides
  89. - role: nickhammond.logrotate
  90. - role: openshift_control_plane
  91. - role: tuned
  92. - role: nuage_ca
  93. when: openshift_use_nuage | default(false) | bool
  94. - role: nuage_common
  95. when: openshift_use_nuage | default(false) | bool
  96. - role: nuage_master
  97. when: openshift_use_nuage | default(false) | bool
  98. - role: calico_master
  99. when: openshift_use_calico | default(false) | bool
  100. tasks:
  101. - name: Set up automatic node config reconcilation
  102. run_once: True
  103. import_role:
  104. name: openshift_node_group
  105. tasks_from: sync
  106. - import_role:
  107. name: kuryr
  108. tasks_from: master
  109. when: openshift_use_kuryr | default(false) | bool
  110. - name: setup bootstrap settings
  111. import_tasks: tasks/enable_bootstrap.yml
  112. post_tasks:
  113. - name: Create group for deployment type
  114. group_by: key=oo_masters_deployment_type_{{ openshift_deployment_type }}
  115. changed_when: False
  116. - name: Re-enable excluders
  117. import_role:
  118. name: openshift_excluder
  119. vars:
  120. r_openshift_excluder_action: enable
  121. - name: Deploy the central bootstrap configuration
  122. hosts: oo_first_master
  123. gather_facts: no
  124. tasks:
  125. - name: setup bootstrap settings
  126. import_tasks: tasks/enable_bootstrap_config.yml
  127. - name: Ensure inventory labels are assigned to masters
  128. hosts: oo_masters_to_config
  129. gather_facts: no
  130. roles:
  131. - role: openshift_manage_node
  132. openshift_master_host: "{{ groups.oo_first_master.0 }}"
  133. openshift_manage_node_is_master: "{{ ('oo_masters_to_config' in group_names) | bool }}"
  134. openshift_node_master_api_url: "{{ hostvars[groups.oo_first_master.0].openshift.master.api_url }}"
  135. - name: Master Install Checkpoint End
  136. hosts: all
  137. gather_facts: false
  138. tasks:
  139. - name: Set Master install 'Complete'
  140. run_once: true
  141. set_stats:
  142. data:
  143. installer_phase_master:
  144. status: "Complete"
  145. end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"