config.yml 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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. get_checksum: false
  30. get_attributes: false
  31. get_mime: false
  32. register: rpmgenerated_config
  33. - name: Remove RPM generated config files if present
  34. file:
  35. path: "/etc/origin/{{ item }}"
  36. state: absent
  37. when:
  38. - rpmgenerated_config.stat.exists == true
  39. - openshift_deployment_type == 'openshift-enterprise'
  40. with_items:
  41. - master
  42. - node
  43. - .config_managed
  44. - openshift_facts:
  45. role: master
  46. local_facts:
  47. api_port: "{{ openshift_master_api_port }}"
  48. api_url: "{{ openshift_master_api_url | default(None) }}"
  49. api_use_ssl: "{{ openshift_master_api_use_ssl | default(None) }}"
  50. controllers_port: "{{ openshift_master_controllers_port | default(None) }}"
  51. public_api_url: "{{ openshift_master_public_api_url | default(None) }}"
  52. cluster_hostname: "{{ openshift_master_cluster_hostname | default(None) }}"
  53. cluster_public_hostname: "{{ openshift_master_cluster_public_hostname | default(None) }}"
  54. console_path: "{{ openshift_master_console_path | default(None) }}"
  55. console_port: "{{ openshift_master_console_port | default(None) }}"
  56. console_url: "{{ openshift_master_console_url | default(None) }}"
  57. console_use_ssl: "{{ openshift_master_console_use_ssl | default(None) }}"
  58. public_console_url: "{{ openshift_master_public_console_url | default(None) }}"
  59. - name: Generate or retrieve existing session secrets
  60. hosts: oo_first_master
  61. roles:
  62. - role: openshift_facts
  63. tasks:
  64. - import_role:
  65. name: openshift_control_plane
  66. tasks_from: generate_session_secrets.yml
  67. - name: Configure masters
  68. hosts: oo_masters_to_config
  69. any_errors_fatal: true
  70. pre_tasks:
  71. - name: Prepare the bootstrap node config on masters for self-hosting
  72. import_role:
  73. name: openshift_node_group
  74. tasks_from: bootstrap.yml
  75. - name: Have the masters automatically pull their configuration
  76. import_role:
  77. name: openshift_node_group
  78. tasks_from: bootstrap_config.yml
  79. roles:
  80. - role: openshift_master_facts
  81. - role: openshift_cloud_provider
  82. when: openshift_cloudprovider_kind is defined
  83. - role: openshift_builddefaults
  84. - role: openshift_buildoverrides
  85. - role: openshift_control_plane
  86. - role: tuned
  87. - role: nuage_common
  88. when: openshift_use_nuage | default(false) | bool
  89. - role: nuage_ca
  90. when: openshift_use_nuage | default(false) | bool
  91. - role: nuage_master
  92. when: openshift_use_nuage | default(false) | bool
  93. - role: calico_master
  94. when: openshift_use_calico | default(false) | bool
  95. tasks:
  96. - import_role:
  97. name: kuryr
  98. tasks_from: master.yaml
  99. when: openshift_use_kuryr | default(false) | bool
  100. - name: setup bootstrap settings
  101. import_tasks: tasks/enable_bootstrap.yml
  102. post_tasks:
  103. - name: Create group for deployment type
  104. group_by: key=oo_masters_deployment_type_{{ openshift_deployment_type }}
  105. changed_when: False
  106. - name: Re-enable excluders
  107. import_role:
  108. name: openshift_excluder
  109. vars:
  110. r_openshift_excluder_action: enable
  111. - name: Deploy the central bootstrap configuration
  112. hosts: oo_first_master
  113. gather_facts: no
  114. tasks:
  115. - name: setup bootstrap settings
  116. import_tasks: tasks/enable_bootstrap_config.yml
  117. - name: setup automatic node config reconcilation
  118. run_once: True
  119. import_role:
  120. name: openshift_node_group
  121. tasks_from: sync.yml
  122. - name: Ensure inventory labels are assigned to masters
  123. hosts: oo_masters_to_config
  124. gather_facts: no
  125. roles:
  126. - role: openshift_manage_node
  127. openshift_master_host: "{{ groups.oo_first_master.0 }}"
  128. openshift_manage_node_is_master: "{{ ('oo_masters_to_config' in group_names) | bool }}"
  129. openshift_node_master_api_url: "{{ hostvars[groups.oo_first_master.0].openshift.master.api_url }}"
  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') }}"