summaryrefslogtreecommitdiffstats
path: root/roles/openshift_metrics/tasks/uninstall_hosa.yaml
blob: ae3306496cb85b4cfcaac173dddbb51308b72981 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
---
- name: remove Hawkular Agent (HOSA) components
  command: >
    {{ openshift_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_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'