Merge "mecm-mepm uninstall playbook added"
[ealt-edge.git] / ocd / infra / playbooks / roles / eg_mep / tasks / uninstall.yml
1 #
2 # Copyright 2020 Huawei Technologies Co., Ltd.
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #     http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 #
16
17 ---
18
19 - name: Uninstall ssl config mep helm chart
20   command: helm uninstall mep-edgegallery
21   ignore_errors: yes
22   no_log: True
23
24 - name: Delete ssl config pg secret
25   command: kubectl delete secret pg-secret -n mep
26   ignore_errors: yes
27   no_log: True
28
29 - name: Delete ssl config mep ssl
30   command: kubectl delete secret mep-ssl -n mep
31   ignore_errors: yes
32   no_log: True
33
34 - name: Delete ssl config mep mep auth
35   command: kubectl delete secret mepauth-secret -n mep
36   ignore_errors: yes
37   no_log: True
38
39 - name: Delete ssl config namesapce mep
40   command: kubectl delete ns mep
41   ignore_errors: yes
42   no_log: True
43
44 - name: Delete network isolation multus eg sp controller
45   # yamllint disable rule:line-length
46   command: kubectl delete -f /tmp/eg_mep/deploy/edge/network-isolation/eg-sp-controller.yaml
47   # yamllint disable rule:line-length
48   args:
49     chdir: /tmp/eg_mep/deploy/
50   ignore_errors: yes
51   no_log: True
52
53 - name: Delete network isolation multus eg sp rbac
54   # yamllint disable rule:line-length
55   command: kubectl delete -f /tmp/eg_mep/deploy/conf/edge/network-isolation/eg-sp-rbac.yaml
56   # yamllint disable rule:line-length
57   args:
58     chdir: /tmp/eg_mep/deploy/
59   ignore_errors: yes
60   no_log: True
61
62 - name: Delete network isolation multus
63   command: kubectl delete -f /tmp/eg_mep/deploy/conf/edge/network-isolation/multus.yaml
64   args:
65     chdir: /tmp/eg_mep/deploy/
66   ignore_errors: yes
67   no_log: True
68
69 - name: Delete network isolation rm host local
70   command: rm /opt/cni/bin/macvlan /opt/cni/bin/host-local
71   args:
72     chdir: /tmp/remote-platform/
73   ignore_errors: yes
74   no_log: True
75
76 - name: Delete network isolation eg mp1
77   command: ip link set dev eg-mp1 down
78   args:
79     chdir: /tmp/remote-platform/
80   ignore_errors: yes
81   no_log: True
82
83 - name: Delete nnetwork isolation eg mp1 link
84   command: ip link delete eg-mp1
85   args:
86     chdir: /tmp/remote-platform/
87   ignore_errors: yes
88   no_log: True
89
90 - name: Delete network isolation eg mm5
91   command: ip link set dev eg-mm5 down
92   args:
93     chdir: /tmp/remote-platform/
94   ignore_errors: yes
95   no_log: True
96
97 - name: Delete network isolation eg mm5 link
98   command: ip link delete eg-mm5
99   args:
100     chdir: /tmp/remote-platform/
101   ignore_errors: yes
102   no_log: True
103
104 - name: Delete network isolation multus rm
105   command: rm /opt/cni/bin/multus
106   args:
107     chdir: /tmp/remote-platform/
108   ignore_errors: yes
109   no_log: True
110
111 - name: Uninstall dns metallb config mep
112   command: kubectl delete -f /tmp/eg_mep/deploy/conf/edge/metallb/config-map.yaml
113   args:
114     chdir: /tmp/eg_mep/deploy/
115   ignore_errors: yes
116   no_log: True
117
118 - name: Delete dns metallb
119   command: kubectl delete -f /tmp/eg_mep/deploy/conf/edge/metallb/metallb.yaml
120   args:
121     chdir: /tmp/eg_mep/deploy/
122   ignore_errors: yes
123   no_log: True
124
125 - name: Delete dns metallb namespace
126   # yamllint disable rule:line-length
127   command: kubectl delete -f /tmp/eg_mep/deploy/conf/edge/metallb/namespace.yaml
128   # yamllint disable rule:line-length
129   args:
130     chdir: /tmp/eg_mep/deploy/
131   ignore_errors: yes
132   no_log: True
133
134 - name: Delete dns namesapce metallb
135   command: kubectl delete secret memberlist -n metallb-system
136   ignore_errors: yes
137   no_log: True