start_cluster.yaml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. ---
  2. - name: Retrieve list of fluentd hosts
  3. oc_obj:
  4. state: list
  5. kind: node
  6. when: "'--all' in openshift_logging_fluentd_hosts"
  7. register: fluentd_hosts
  8. - name: Set fact openshift_logging_fluentd_hosts
  9. set_fact:
  10. openshift_logging_fluentd_hosts: "{{ fluentd_hosts.results.results[0]['items'] | map(attribute='metadata.name') | list }}"
  11. when: "'--all' in openshift_logging_fluentd_hosts"
  12. - name: start fluentd
  13. oc_label:
  14. name: "{{ fluentd_host }}"
  15. kind: node
  16. state: add
  17. labels: "{{ openshift_logging_fluentd_nodeselector | oo_dict_to_list_of_dict }}"
  18. with_items: "{{ openshift_logging_fluentd_hosts }}"
  19. loop_control:
  20. loop_var: fluentd_host
  21. - name: Retrieve mux
  22. oc_obj:
  23. state: list
  24. kind: dc
  25. selector: "component=mux"
  26. namespace: "{{openshift_logging_namespace}}"
  27. register: mux_dc
  28. when: openshift_logging_use_mux
  29. - name: start mux
  30. oc_scale:
  31. kind: dc
  32. name: "{{ object }}"
  33. namespace: "{{openshift_logging_namespace}}"
  34. replicas: "{{ openshift_logging_mux_replica_count | default (1) }}"
  35. with_items: "{{ mux_dc.results.results[0]['items'] | map(attribute='metadata.name') | list }}"
  36. loop_control:
  37. loop_var: object
  38. when:
  39. - mux_dc.results is defined
  40. - mux_dc.results.results is defined
  41. - openshift_logging_use_mux
  42. - name: Retrieve elasticsearch
  43. oc_obj:
  44. state: list
  45. kind: dc
  46. selector: "component=es"
  47. namespace: "{{openshift_logging_namespace}}"
  48. register: es_dc
  49. - name: start elasticsearch
  50. oc_scale:
  51. kind: dc
  52. name: "{{ object }}"
  53. namespace: "{{openshift_logging_namespace}}"
  54. replicas: 1
  55. with_items: "{{ es_dc.results.results[0]['items'] | map(attribute='metadata.name') | list }}"
  56. loop_control:
  57. loop_var: object
  58. - name: Retrieve kibana
  59. oc_obj:
  60. state: list
  61. kind: dc
  62. selector: "component=kibana"
  63. namespace: "{{openshift_logging_namespace}}"
  64. register: kibana_dc
  65. - name: start kibana
  66. oc_scale:
  67. kind: dc
  68. name: "{{ object }}"
  69. namespace: "{{openshift_logging_namespace}}"
  70. replicas: "{{ openshift_logging_kibana_replica_count | default (1) }}"
  71. with_items: "{{ kibana_dc.results.results[0]['items'] | map(attribute='metadata.name') | list }}"
  72. loop_control:
  73. loop_var: object
  74. - name: Retrieve curator
  75. oc_obj:
  76. state: list
  77. kind: dc
  78. selector: "component=curator"
  79. namespace: "{{openshift_logging_namespace}}"
  80. register: curator_dc
  81. - name: start curator
  82. oc_scale:
  83. kind: dc
  84. name: "{{ object }}"
  85. namespace: "{{openshift_logging_namespace}}"
  86. replicas: 1
  87. with_items: "{{ curator_dc.results.results[0]['items'] | map(attribute='metadata.name') | list }}"
  88. loop_control:
  89. loop_var: object
  90. - name: Retrieve elasticsearch-ops
  91. oc_obj:
  92. state: list
  93. kind: dc
  94. selector: "component=es-ops"
  95. namespace: "{{openshift_logging_namespace}}"
  96. register: es_dc
  97. - name: start elasticsearch-ops
  98. oc_scale:
  99. kind: dc
  100. name: "{{ object }}"
  101. namespace: "{{openshift_logging_namespace}}"
  102. replicas: 1
  103. with_items: "{{ es_dc.results.results[0]['items'] | map(attribute='metadata.name') | list }}"
  104. loop_control:
  105. loop_var: object
  106. when: openshift_logging_use_ops | bool
  107. - name: Retrieve kibana-ops
  108. oc_obj:
  109. state: list
  110. kind: dc
  111. selector: "component=kibana-ops"
  112. namespace: "{{openshift_logging_namespace}}"
  113. register: kibana_dc
  114. - name: start kibana-ops
  115. oc_scale:
  116. kind: dc
  117. name: "{{ object }}"
  118. namespace: "{{openshift_logging_namespace}}"
  119. replicas: "{{ openshift_logging_kibana_ops_replica_count | default (1) }}"
  120. with_items: "{{ kibana_dc.results.results[0]['items'] | map(attribute='metadata.name') | list }}"
  121. loop_control:
  122. loop_var: object
  123. when: openshift_logging_use_ops | bool
  124. - name: Retrieve curator
  125. oc_obj:
  126. state: list
  127. kind: dc
  128. selector: "component=curator-ops"
  129. namespace: "{{openshift_logging_namespace}}"
  130. register: curator_dc
  131. - name: start curator-ops
  132. oc_scale:
  133. kind: dc
  134. name: "{{ object }}"
  135. namespace: "{{openshift_logging_namespace}}"
  136. replicas: 1
  137. with_items: "{{ curator_dc.results.results[0]['items'] | map(attribute='metadata.name') | list }}"
  138. loop_control:
  139. loop_var: object
  140. when: openshift_logging_use_ops | bool