uninstall_metrics.yaml 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. ---
  2. - name: stop metrics
  3. include_tasks: stop_metrics.yaml
  4. - name: remove metrics components
  5. command: >
  6. {{ openshift_client_binary }} -n {{ openshift_metrics_project }} --config={{ mktemp.stdout }}/admin.kubeconfig
  7. delete --ignore-not-found --selector=metrics-infra
  8. all,sa,secrets,templates,routes,pvc,rolebindings,clusterrolebindings,clusterrole
  9. register: delete_metrics
  10. changed_when: delete_metrics.stdout != 'No resources found'
  11. - name: remove rolebindings
  12. command: >
  13. {{ openshift_client_binary }} -n {{ openshift_metrics_project }} --config={{ mktemp.stdout }}/admin.kubeconfig
  14. delete --ignore-not-found
  15. rolebinding/hawkular-view
  16. clusterrolebinding/heapster-cluster-reader
  17. clusterrolebinding/hawkular-metrics
  18. changed_when: delete_metrics.stdout != 'No resources found'
  19. # Update the web config in openshift-web-console namespace
  20. - name: Remove metrics route information from the web console config
  21. include_role:
  22. name: openshift_web_console
  23. tasks_from: update_console_config.yml
  24. vars:
  25. console_config_edits:
  26. - key: clusterInfo#metricsPublicURL
  27. value: ""
  28. when:
  29. - openshift_web_console_install | default(true) | bool