config.yml 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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. 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. - name: Set up automatic node config reconcilation
  99. run_once: True
  100. import_role:
  101. name: openshift_node_group
  102. tasks_from: sync
  103. - import_role:
  104. name: kuryr
  105. tasks_from: master
  106. when: openshift_use_kuryr | default(false) | bool
  107. - name: setup bootstrap settings
  108. import_tasks: tasks/enable_bootstrap.yml
  109. post_tasks:
  110. - name: Create group for deployment type
  111. group_by: key=oo_masters_deployment_type_{{ openshift_deployment_type }}
  112. changed_when: False
  113. - name: Re-enable excluders
  114. import_role:
  115. name: openshift_excluder
  116. vars:
  117. r_openshift_excluder_action: enable
  118. - name: Deploy the central bootstrap configuration
  119. hosts: oo_first_master
  120. gather_facts: no
  121. tasks:
  122. - name: setup bootstrap settings
  123. import_tasks: tasks/enable_bootstrap_config.yml
  124. - name: Ensure inventory labels are assigned to masters
  125. hosts: oo_masters_to_config
  126. gather_facts: no
  127. roles:
  128. - role: openshift_manage_node
  129. openshift_master_host: "{{ groups.oo_first_master.0 }}"
  130. openshift_manage_node_is_master: "{{ ('oo_masters_to_config' in group_names) | bool }}"
  131. openshift_node_master_api_url: "{{ hostvars[groups.oo_first_master.0].openshift.master.api_url }}"
  132. - name: Master Install Checkpoint End
  133. hosts: all
  134. gather_facts: false
  135. tasks:
  136. - name: Set Master install 'Complete'
  137. run_once: true
  138. set_stats:
  139. data:
  140. installer_phase_master:
  141. status: "Complete"
  142. end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"