pre-flight.yml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. ---
  2. - name: Pre-flight checks only.
  3. hosts: workstation.lab.example.com
  4. gather_subset: min
  5. become: no
  6. tasks:
  7. # Deploy packages.
  8. - include_role:
  9. name: install-packages
  10. apply:
  11. tags:
  12. - install
  13. tags:
  14. - install
  15. # Get auth info, check cluster comms.
  16. - include_role:
  17. name: check-env
  18. apply:
  19. tags:
  20. - check
  21. tags:
  22. - check
  23. # THIS MUST BE APPLIED BEFORE FIX OPERATORS!
  24. - include_role:
  25. name: remove-operators
  26. apply:
  27. tags:
  28. - prep
  29. - remove
  30. loop: "{{ removed_operators }}"
  31. loop_control:
  32. loop_var: role
  33. tags:
  34. - prep
  35. - remove
  36. # Fix the operator catalog sources.
  37. - include_role:
  38. name: fix-operators
  39. apply:
  40. tags:
  41. - prep
  42. - fix
  43. tags:
  44. - prep
  45. - fix
  46. # Re-apply any operators that have had their catalog sources changed and install new ones.
  47. - include_role:
  48. name: deploy-operators
  49. apply:
  50. tags:
  51. - prep
  52. - deploy
  53. loop: "{{ added_operators }}"
  54. loop_control:
  55. loop_var: role
  56. tags:
  57. - prep
  58. - deploy
  59. # Apply some labels to nodes.
  60. - include_role:
  61. name: apply-node-labels
  62. apply:
  63. tags:
  64. - prep
  65. - setup
  66. - labels
  67. tags:
  68. - prep
  69. - setup
  70. - labels
  71. # Ensure RBAC resources (ClusterRoles and global Groups) are there.
  72. - include_role:
  73. name: setup-rbac
  74. apply:
  75. tags:
  76. - prep
  77. - setup
  78. - rbac
  79. tags:
  80. - prep
  81. - setup
  82. - rbac
  83. # Ensure a Keycloak is there (use rhbk_state=absent var to remove).
  84. - include_role:
  85. name: deploy-rhbk
  86. apply:
  87. tags:
  88. - prep
  89. - setup
  90. - sso
  91. tags:
  92. - prep
  93. - setup
  94. - sso
  95. # Ensure OpenShift OAuth is using the Keycloak.
  96. - include_role:
  97. name: setup-auth
  98. apply:
  99. tags:
  100. - prep
  101. - setup
  102. - auth
  103. tags:
  104. - prep
  105. - setup
  106. - auth
  107. # Enable user workload monitoring.
  108. - include_role:
  109. name: user-workload-monitoring
  110. apply:
  111. tags:
  112. - prep
  113. - setup
  114. - monitor
  115. tags:
  116. - prep
  117. - setup
  118. - monitor
  119. # Apply some labels to projects.
  120. - include_role:
  121. name: apply-infra-labels
  122. apply:
  123. tags:
  124. - prep
  125. - setup
  126. - labels
  127. tags:
  128. - prep
  129. - setup
  130. - labels
  131. # TODO: deploy grafana (?)
  132. # TODO: deploy logging (?)
  133. # TODO: logging requires minio
  134. # TODO: create a private network (nmstate + bridges?)
  135. # Some additional configuration for infra.
  136. - name: Ensure HAProxy on utility does not forward plaintext HTTP to OpenShift.
  137. hosts: utility.lab.example.com
  138. gather_subset: min
  139. become: yes
  140. tasks:
  141. - include_role:
  142. name: setup-ingress
  143. apply:
  144. tags:
  145. - prep
  146. - ingress
  147. tags:
  148. - prep
  149. - ingress
  150. ...