config.yml 4.9 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. 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.yml
  76. - name: Have the masters automatically pull their configuration
  77. import_role:
  78. name: openshift_node_group
  79. tasks_from: bootstrap_config.yml
  80. roles:
  81. - role: openshift_master_facts
  82. - role: openshift_cloud_provider
  83. when: openshift_cloudprovider_kind is defined
  84. - role: openshift_builddefaults
  85. - role: openshift_buildoverrides
  86. - role: nickhammond.logrotate
  87. - role: openshift_control_plane
  88. - role: tuned
  89. - role: nuage_ca
  90. when: openshift_use_nuage | default(false) | bool
  91. - role: nuage_common
  92. when: openshift_use_nuage | default(false) | bool
  93. - role: nuage_master
  94. when: openshift_use_nuage | default(false) | bool
  95. - role: calico_master
  96. when: openshift_use_calico | default(false) | bool
  97. tasks:
  98. - import_role:
  99. name: kuryr
  100. tasks_from: master.yaml
  101. when: openshift_use_kuryr | default(false) | bool
  102. - name: setup bootstrap settings
  103. import_tasks: tasks/enable_bootstrap.yml
  104. post_tasks:
  105. - name: Create group for deployment type
  106. group_by: key=oo_masters_deployment_type_{{ openshift_deployment_type }}
  107. changed_when: False
  108. - name: Re-enable excluders
  109. import_role:
  110. name: openshift_excluder
  111. vars:
  112. r_openshift_excluder_action: enable
  113. - name: Deploy the central bootstrap configuration
  114. hosts: oo_first_master
  115. gather_facts: no
  116. tasks:
  117. - name: setup bootstrap settings
  118. import_tasks: tasks/enable_bootstrap_config.yml
  119. - name: Create sync daemonset
  120. hosts: oo_first_master
  121. gather_facts: no
  122. tasks:
  123. - name: Set up automatic node config reconcilation
  124. run_once: True
  125. import_role:
  126. name: openshift_node_group
  127. tasks_from: sync.yml
  128. - name: Ensure inventory labels are assigned to masters
  129. hosts: oo_masters_to_config
  130. gather_facts: no
  131. roles:
  132. - role: openshift_manage_node
  133. openshift_master_host: "{{ groups.oo_first_master.0 }}"
  134. openshift_manage_node_is_master: "{{ ('oo_masters_to_config' in group_names) | bool }}"
  135. openshift_node_master_api_url: "{{ hostvars[groups.oo_first_master.0].openshift.master.api_url }}"
  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') }}"