upgrade_logging.yaml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. ---
  2. - name: Stop the Cluster
  3. include: stop_cluster.yaml
  4. - name: Upgrade logging
  5. include: install_logging.yaml
  6. vars:
  7. start_cluster: False
  8. # start ES so that we can run migrate script
  9. - command: >
  10. {{openshift.common.client_binary}} --config={{mktemp.stdout}}/admin.kubeconfig get dc -l component=es -o name -n {{openshift_logging_namespace}}
  11. register: es_dc
  12. check_mode: no
  13. - name: start elasticsearch
  14. include: scale.yaml
  15. vars:
  16. desired: 1
  17. with_items: "{{es_dc.stdout_lines}}"
  18. loop_control:
  19. loop_var: object
  20. - command: >
  21. {{ openshift.common.client_binary}} --config={{mktemp.stdout}}/admin.kubeconfig get pods -n {{openshift_logging_namespace}} -l component=es -o jsonpath='{.items[?(@.status.phase == "Running")].metadata.name}'
  22. register: running_pod
  23. until: running_pod.stdout != ''
  24. retries: 30
  25. delay: 10
  26. changed_when: no
  27. check_mode: no
  28. - name: Run upgrade script
  29. script: es_migration.sh {{openshift.common.config_base}}/logging/ca.crt {{openshift.common.config_base}}/logging/system.admin.key {{openshift.common.config_base}}/logging/system.admin.crt {{openshift_logging_es_host}} {{openshift_logging_es_port}} {{openshift_logging_namespace}}
  30. register: script_output
  31. changed_when:
  32. - script_output.rc == 0
  33. - script_output.stdout.find("skipping update_for_uuid") == -1 or script_output.stdout.find("skipping update_for_common_data_model") == -1
  34. - name: Start up rest of cluster
  35. include: start_cluster.yaml