-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathawx-remove.yml
60 lines (48 loc) · 1.96 KB
/
awx-remove.yml
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
---
- name: Remove AWX
hosts: localhost
become: yes
tasks:
- name: Remove awx deployment
shell: kubectl delete deployment awx-operator-controller-manager -n awx
ignore_errors: yes
- name: Remove service account
shell: kubectl delete serviceaccount awx-operator-controller-manager -n awx
ignore_errors: yes
- name: Remove role binding
shell: kubectl delete rolebinding awx-operator-awx-manager-rolebinding -n awx
ignore_errors: yes
- name: remove role
shell: kubectl delete role awx-operator-awx-manager-role -n awx
ignore_errors: yes
- name: scales all deployments in the awx namespace to zero replicas
shell: kubectl scale deployment --all --replicas=0 -n awx
ignore_errors: yes
- name: remove deployments
shell: kubectl delete deployments.apps/awx-web deployments.apps/awx-task -n awx
ignore_errors: yes
- name: remove statefulsets
shell: kubectl delete statefulsets.apps/awx-postgres-13 -n awx
ignore_errors: yes
- name: remove services
shell: kubectl delete service/awx-operator-controller-manager-metrics-service service/awx-postgres-13 service/awx-service -n awx
ignore_errors: yes
- name: Get persistent volume claim name
command: kubectl get pvc -n awx -o custom-columns=:metadata.name --no-headers
register: pvc_output
ignore_errors: yes
- name: Remove persistent volume claim
command: kubectl delete pvc {{ pvc_output.stdout }} -n awx
when: pvc_output.stdout != ""
ignore_errors: yes
- name: Get persistent volume name
command: kubectl get pv -n awx -o custom-columns=:metadata.name --no-headers
register: pv_output
ignore_errors: yes
- name: Remove persistent volume
command: kubectl delete pv {{ pv_output.stdout }}
when: pv_output.stdout != ""
ignore_errors: yes
- name: Remove namespace awx
shell: kubectl delete namespace awx
ignore_errors: yes