eg_mep uninstall playbook added 43/3843/1
authorarvindpatel <arvind.patel@huawei.com>
Wed, 28 Oct 2020 11:56:41 +0000 (17:26 +0530)
committerarvindpatel <arvind.patel@huawei.com>
Wed, 28 Oct 2020 11:57:42 +0000 (17:27 +0530)
Signed-off-by: arvindpatel <arvind.patel@huawei.com>
Change-Id: I4402ee4ae0839a57f2a90f543627f0b312bfe082

ocd/infra/playbooks/roles/eg_mep/tasks/main.yml
ocd/infra/playbooks/roles/eg_mep/tasks/uninstall.yml [new file with mode: 0644]

index ff35318..70416a7 100644 (file)
@@ -18,4 +18,9 @@
 
 # tasks file for eg_mep
 - include: "install.yml"
+  static: false
   when: operation == 'install'
+
+- include: "uninstall.yml"
+  static: false
+  when: operation == 'uninstall'
diff --git a/ocd/infra/playbooks/roles/eg_mep/tasks/uninstall.yml b/ocd/infra/playbooks/roles/eg_mep/tasks/uninstall.yml
new file mode 100644 (file)
index 0000000..d64aa0d
--- /dev/null
@@ -0,0 +1,137 @@
+#
+# Copyright 2020 Huawei Technologies Co., Ltd.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+---
+
+- name: Uninstall ssl config mep helm chart
+  command: helm uninstall mep-edgegallery
+  ignore_errors: yes
+  no_log: True
+
+- name: Delete ssl config pg secret
+  command: kubectl delete secret pg-secret -n mep
+  ignore_errors: yes
+  no_log: True
+
+- name: Delete ssl config mep ssl
+  command: kubectl delete secret mep-ssl -n mep
+  ignore_errors: yes
+  no_log: True
+
+- name: Delete ssl config mep mep auth
+  command: kubectl delete secret mepauth-secret -n mep
+  ignore_errors: yes
+  no_log: True
+
+- name: Delete ssl config namesapce mep
+  command: kubectl delete ns mep
+  ignore_errors: yes
+  no_log: True
+
+- name: Delete network isolation multus eg sp controller
+  # yamllint disable rule:line-length
+  command: kubectl delete -f /tmp/eg_mep/deploy/edge/network-isolation/eg-sp-controller.yaml
+  # yamllint disable rule:line-length
+  args:
+    chdir: /tmp/eg_mep/deploy/
+  ignore_errors: yes
+  no_log: True
+
+- name: Delete network isolation multus eg sp rbac
+  # yamllint disable rule:line-length
+  command: kubectl delete -f /tmp/eg_mep/deploy/conf/edge/network-isolation/eg-sp-rbac.yaml
+  # yamllint disable rule:line-length
+  args:
+    chdir: /tmp/eg_mep/deploy/
+  ignore_errors: yes
+  no_log: True
+
+- name: Delete network isolation multus
+  command: kubectl delete -f /tmp/eg_mep/deploy/conf/edge/network-isolation/multus.yaml
+  args:
+    chdir: /tmp/eg_mep/deploy/
+  ignore_errors: yes
+  no_log: True
+
+- name: Delete network isolation rm host local
+  command: rm /opt/cni/bin/macvlan /opt/cni/bin/host-local
+  args:
+    chdir: /tmp/remote-platform/
+  ignore_errors: yes
+  no_log: True
+
+- name: Delete network isolation eg mp1
+  command: ip link set dev eg-mp1 down
+  args:
+    chdir: /tmp/remote-platform/
+  ignore_errors: yes
+  no_log: True
+
+- name: Delete nnetwork isolation eg mp1 link
+  command: ip link delete eg-mp1
+  args:
+    chdir: /tmp/remote-platform/
+  ignore_errors: yes
+  no_log: True
+
+- name: Delete network isolation eg mm5
+  command: ip link set dev eg-mm5 down
+  args:
+    chdir: /tmp/remote-platform/
+  ignore_errors: yes
+  no_log: True
+
+- name: Delete network isolation eg mm5 link
+  command: ip link delete eg-mm5
+  args:
+    chdir: /tmp/remote-platform/
+  ignore_errors: yes
+  no_log: True
+
+- name: Delete network isolation multus rm
+  command: rm /opt/cni/bin/multus
+  args:
+    chdir: /tmp/remote-platform/
+  ignore_errors: yes
+  no_log: True
+
+- name: Uninstall dns metallb config mep
+  command: kubectl delete -f /tmp/eg_mep/deploy/conf/edge/metallb/config-map.yaml
+  args:
+    chdir: /tmp/eg_mep/deploy/
+  ignore_errors: yes
+  no_log: True
+
+- name: Delete dns metallb
+  command: kubectl delete -f /tmp/eg_mep/deploy/conf/edge/metallb/metallb.yaml
+  args:
+    chdir: /tmp/eg_mep/deploy/
+  ignore_errors: yes
+  no_log: True
+
+- name: Delete dns metallb namespace
+  # yamllint disable rule:line-length
+  command: kubectl delete -f /tmp/eg_mep/deploy/conf/edge/metallb/namespace.yaml
+  # yamllint disable rule:line-length
+  args:
+    chdir: /tmp/eg_mep/deploy/
+  ignore_errors: yes
+  no_log: True
+
+- name: Delete dns namesapce metallb
+  command: kubectl delete secret memberlist -n metallb-system
+  ignore_errors: yes
+  no_log: True