summaryrefslogtreecommitdiffstats
path: root/roles/openshift_metrics/tasks/uninstall_hosa.yaml
blob: 42ed0246067b7ce47b037eff88d8a7c0ef4e3e2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
---
- name: remove Hawkular Agent (HOSA) components
  command: >
    {{ openshift.common.client_binary }} -n {{ openshift_metrics_hawkular_agent_namespace }} --config={{ mktemp.stdout }}/admin.kubeconfig
    delete --ignore-not-found --selector=metrics-infra=agent
    all,sa,secrets,templates,routes,pvc,rolebindings,clusterrolebindings
  register: delete_metrics
  changed_when: delete_metrics.stdout != 'No resources found'

- name: remove rolebindings
  command: >
    {{ openshift.common.client_binary }} -n {{ openshift_metrics_hawkular_agent_namespace }} --config={{ mktemp.stdout }}/admin.kubeconfig
    delete --ignore-not-found
    clusterrolebinding/hawkular-openshift-agent-rb
  changed_when: delete_metrics.stdout != 'No resources found'