stop_cluster.yaml 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. ---
  2. - shell: >
  3. echo "{{openshift_logging_fluentd_nodeselector}}" | cut -d':' -f1
  4. register: openshift_logging_fluentd_nodeselector_key
  5. - shell: >
  6. echo "{{openshift_logging_fluentd_nodeselector}}" | cut -d' ' -f2
  7. register: openshift_logging_fluentd_nodeselector_value
  8. - shell: >
  9. {{openshift.common.client_binary}} --config={{mktemp.stdout}}/admin.kubeconfig get node -o name | sed "s,^node/,,g"
  10. register: fluentd_hosts
  11. when: "'--all' in openshift_logging_fluentd_hosts"
  12. - name: stop fluentd
  13. include: label_node.yaml
  14. vars:
  15. host: "{{fluentd_host}}"
  16. label: "{{openshift_logging_fluentd_nodeselector_key.stdout}}"
  17. unlabel: True
  18. with_items: "{{(fluentd_hosts.stdout_lines is defined) | ternary(fluentd_hosts.stdout_lines, openshift_logging_fluentd_hosts)}}"
  19. loop_control:
  20. loop_var: fluentd_host
  21. - shell: >
  22. {{openshift.common.client_binary}} --config={{mktemp.stdout}}/admin.kubeconfig get dc -l component=es -o name -n {{openshift_logging_namespace}}
  23. register: es_dc
  24. - name: stop elasticsearch
  25. include: scale.yaml
  26. vars:
  27. desired: 0
  28. with_items: "{{es_dc.stdout_lines}}"
  29. loop_control:
  30. loop_var: object
  31. - shell: >
  32. {{openshift.common.client_binary}} --config={{mktemp.stdout}}/admin.kubeconfig get dc -l component=kibana -o name -n {{openshift_logging_namespace}}
  33. register: kibana_dc
  34. - name: stop kibana
  35. include: scale.yaml
  36. vars:
  37. desired: 0
  38. with_items: "{{kibana_dc.stdout_lines}}"
  39. loop_control:
  40. loop_var: object
  41. - shell: >
  42. {{openshift.common.client_binary}} --config={{mktemp.stdout}}/admin.kubeconfig get dc -l component=curator -o name -n {{openshift_logging_namespace}}
  43. register: curator_dc
  44. - name: stop curator
  45. include: scale.yaml
  46. vars:
  47. desired: 0
  48. with_items: "{{curator_dc.stdout_lines}}"
  49. loop_control:
  50. loop_var: object
  51. - shell: >
  52. {{openshift.common.client_binary}} --config={{mktemp.stdout}}/admin.kubeconfig get dc -l component=es-ops -o name -n {{openshift_logging_namespace}}
  53. register: es_dc
  54. - name: stop elasticsearch-ops
  55. include: scale.yaml
  56. vars:
  57. desired: 0
  58. with_items: "{{es_dc.stdout_lines}}"
  59. loop_control:
  60. loop_var: object
  61. when: openshift_logging_use_ops
  62. - shell: >
  63. {{openshift.common.client_binary}} --config={{mktemp.stdout}}/admin.kubeconfig get dc -l component=kibana-ops -o name -n {{openshift_logging_namespace}}
  64. register: kibana_dc
  65. - name: stop kibana-ops
  66. include: scale.yaml
  67. vars:
  68. desired: 0
  69. with_items: "{{kibana_dc.stdout_lines}}"
  70. loop_control:
  71. loop_var: object
  72. when: openshift_logging_use_ops
  73. - shell: >
  74. {{openshift.common.client_binary}} --config={{mktemp.stdout}}/admin.kubeconfig get dc -l component=curator-ops -o name -n {{openshift_logging_namespace}}
  75. register: curator_dc
  76. - name: stop curator-ops
  77. include: scale.yaml
  78. vars:
  79. desired: 0
  80. with_items: "{{curator_dc.stdout_lines}}"
  81. loop_control:
  82. loop_var: object
  83. when: openshift_logging_use_ops