File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
roles/ci_local_storage/tasks Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change 2424 - provisioned-by={{ cifmw_cls_storage_provisioner }}
2525 register : _pv_info
2626
27- - name : Export PVs as facts
27+ - name : Export PVs and Bound PVCs as facts
2828 ansible.builtin.set_fact :
2929 cifmw_cls_pvs : >-
3030 {{ _pv_info.resources |
3131 selectattr("metadata.name", "defined") |
3232 map(attribute="metadata.name")
3333 }}
34+ cifmw_cls_pvcs : >-
35+ {{ _pv_info.resources |
36+ selectattr("status.phase", "equalto", "Bound") |
37+ selectattr("spec.claimRef", "defined") |
38+ map(attribute="spec.claimRef")
39+ }}
40+
41+ - name : Delete all bound pvcs
42+ kubernetes.core.k8s :
43+ kubeconfig : " {{ cifmw_openshift_kubeconfig }}"
44+ api_key : " {{ cifmw_openshift_token | default(omit)}}"
45+ context : " {{ cifmw_openshift_context | default(omit)}}"
46+ kind : PersistentVolumeClaim
47+ state : absent
48+ api_version : v1
49+ namespace : " {{ item.namespace }}"
50+ name : " {{ item.name }}"
51+ loop : " {{ cifmw_cls_pvcs }}"
3452
3553- name : Delete all pvs
3654 kubernetes.core.k8s :
You can’t perform that action at this time.
0 commit comments