blob: ac12087ece0be7f2696013d2b0618bf3337717eb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
---
- name: stop provisioners
include_tasks: stop_cluster.yaml
# delete the deployment objects that we had created
- name: delete provisioner api objects
command: >
{{ openshift_client_binary }} --config={{ mktemp.stdout }}/admin.kubeconfig
delete {{ item }} --selector provisioners-infra -n {{ openshift_provisioners_project }} --ignore-not-found=true
with_items:
- dc
register: delete_result
changed_when: delete_result.stdout.find("deleted") != -1 and delete_result.rc == 0
# delete our old secrets
- name: delete provisioner secrets
command: >
{{ openshift_client_binary }} --config={{ mktemp.stdout }}/admin.kubeconfig
delete secret {{ item }} -n {{ openshift_provisioners_project }} --ignore-not-found=true
with_items:
- provisioners-efs
ignore_errors: yes
register: delete_result
changed_when: delete_result.stdout.find("deleted") != -1 and delete_result.rc == 0
# delete cluster role bindings
- name: delete cluster role bindings
command: >
{{ openshift_client_binary }} --config={{ mktemp.stdout }}/admin.kubeconfig
delete clusterrolebindings {{ item }} -n {{ openshift_provisioners_project }} --ignore-not-found=true
with_items:
- run-provisioners-efs
register: delete_result
changed_when: delete_result.stdout.find("deleted") != -1 and delete_result.rc == 0
# delete our service accounts
- name: delete service accounts
oc_serviceaccount:
name: "{{ item }}"
namespace: "{{ openshift_provisioners_project }}"
state: absent
with_items:
- provisioners-efs
|