From: Gaurav Agrawal Date: Wed, 28 Oct 2020 12:56:49 +0000 (+0000) Subject: Merge "mecm-mepm uninstall playbook added" X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=commitdiff_plain;h=b53813aee440d6c0a936a2827e5c304cf60d8be1;hp=dfa36265b45a48ebbb44d0edd57eb6abd27ed7ea;p=ealt-edge.git Merge "mecm-mepm uninstall playbook added" --- diff --git a/ocd/infra/playbooks/config.yml b/ocd/infra/playbooks/config.yml index 6571ff1..020d1d4 100644 --- a/ocd/infra/playbooks/config.yml +++ b/ocd/infra/playbooks/config.yml @@ -31,3 +31,11 @@ adminpwd: name: kongpgpwd: name: +interface1: + name: +interface2: + name: +ipaddregmep1: + name: +ipaddregmep5: + name: diff --git a/ocd/infra/playbooks/roles/eg_appstore/tasks/main.yml b/ocd/infra/playbooks/roles/eg_appstore/tasks/main.yml index bb6447b..e8bea5a 100644 --- a/ocd/infra/playbooks/roles/eg_appstore/tasks/main.yml +++ b/ocd/infra/playbooks/roles/eg_appstore/tasks/main.yml @@ -1,5 +1,26 @@ +# +# 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. +# + --- + # tasks file for eg_appstore - include: "install.yml" static: false when: operation == 'install' + +- include: "uninstall.yml" + static: false + when: operation == 'uninstall' diff --git a/ocd/infra/playbooks/roles/eg_appstore/tasks/uninstall.yml b/ocd/infra/playbooks/roles/eg_appstore/tasks/uninstall.yml new file mode 100644 index 0000000..d4e089f --- /dev/null +++ b/ocd/infra/playbooks/roles/eg_appstore/tasks/uninstall.yml @@ -0,0 +1,20 @@ +# +# 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: Unisntall appstore + command: helm uninstall appstore-edgegallery diff --git a/ocd/infra/playbooks/roles/eg_developer/tasks/main.yml b/ocd/infra/playbooks/roles/eg_developer/tasks/main.yml index 44573e9..bab0558 100644 --- a/ocd/infra/playbooks/roles/eg_developer/tasks/main.yml +++ b/ocd/infra/playbooks/roles/eg_developer/tasks/main.yml @@ -19,3 +19,7 @@ - include: "install.yml" static: false when: operation == 'install' + +- include: "uninstall.yml" + static: false + when: operation == 'uninstall' diff --git a/ocd/infra/playbooks/roles/eg_developer/tasks/uninstall.yml b/ocd/infra/playbooks/roles/eg_developer/tasks/uninstall.yml new file mode 100644 index 0000000..41caeee --- /dev/null +++ b/ocd/infra/playbooks/roles/eg_developer/tasks/uninstall.yml @@ -0,0 +1,20 @@ +# +# 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 developer + command: helm uninstall developer-edgegallery diff --git a/ocd/infra/playbooks/roles/eg_mecm-fe/tasks/main.yml b/ocd/infra/playbooks/roles/eg_mecm-fe/tasks/main.yml index 51d8432..b168173 100644 --- a/ocd/infra/playbooks/roles/eg_mecm-fe/tasks/main.yml +++ b/ocd/infra/playbooks/roles/eg_mecm-fe/tasks/main.yml @@ -19,3 +19,7 @@ - include: "install.yml" static: false when: operation == 'install' + +- include: "uninstall.yml" + static: false + when: operation == 'uninstall' diff --git a/ocd/infra/playbooks/roles/eg_mecm-fe/tasks/uninstall.yml b/ocd/infra/playbooks/roles/eg_mecm-fe/tasks/uninstall.yml new file mode 100644 index 0000000..c51438e --- /dev/null +++ b/ocd/infra/playbooks/roles/eg_mecm-fe/tasks/uninstall.yml @@ -0,0 +1,20 @@ +# +# 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 mecm fe + command: helm uninstall mecm-fe-edgegallery diff --git a/ocd/infra/playbooks/roles/eg_mecm-meo/tasks/main.yml b/ocd/infra/playbooks/roles/eg_mecm-meo/tasks/main.yml index d6cb3cf..77d70db 100644 --- a/ocd/infra/playbooks/roles/eg_mecm-meo/tasks/main.yml +++ b/ocd/infra/playbooks/roles/eg_mecm-meo/tasks/main.yml @@ -19,3 +19,7 @@ - include: "install.yml" static: false when: operation == 'install' + +- include: "uninstall.yml" + static: false + when: operation == 'uninstall' diff --git a/ocd/infra/playbooks/roles/eg_mecm-meo/tasks/uninstall.yml b/ocd/infra/playbooks/roles/eg_mecm-meo/tasks/uninstall.yml new file mode 100644 index 0000000..3f93558 --- /dev/null +++ b/ocd/infra/playbooks/roles/eg_mecm-meo/tasks/uninstall.yml @@ -0,0 +1,23 @@ +# +# 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 mecm meo + command: helm uninstall mecm-meo-edgegallery + +- name: Uninstall sercets + command: kubectl delete secret mecm-ssl-secret edgegallery-mecm-secret diff --git a/ocd/infra/playbooks/roles/eg_mep/tasks/install.yml b/ocd/infra/playbooks/roles/eg_mep/tasks/install.yml index 1a9d1d2..12b70d3 100644 --- a/ocd/infra/playbooks/roles/eg_mep/tasks/install.yml +++ b/ocd/infra/playbooks/roles/eg_mep/tasks/install.yml @@ -120,14 +120,14 @@ msg: Setup_interfaces execution start - name: Link eg mep macvlan - command: ip link add eg-mp1 link eth0 type macvlan mode bridge + command: ip link add eg-mp1 link {{ vardata.interface1.name}} type macvlan mode bridge args: chdir: /tmp/eg_mep/deploy/ ignore_errors: yes no_log: True - name: Link eg mep macvlan - command: ip addr add 200.1.1.2/24 dev eg-mp1 + command: ip addr add {{ vardata.ipaddregmep1.name}} dev eg-mp1 args: chdir: /tmp/eg_mep/deploy/ ignore_errors: yes @@ -141,14 +141,14 @@ no_log: True - name: Link eg eg mm5 with eth1 - command: ip link add eg-mm5 link eth1 type macvlan mode bridge + command: ip link add eg-mm5 link {{ vardata.interface2.name}} type macvlan mode bridge args: chdir: /tmp/eg_mep/deploy/ ignore_errors: yes no_log: True - name: Link eg eg mm5 ip addr - command: ip addr add 100.1.1.2/24 dev eg-mm5 + command: ip addr add {{ vardata.ipaddregmep5.name}} dev eg-mm5 args: chdir: /tmp/eg_mep/deploy/ ignore_errors: yes @@ -173,7 +173,7 @@ - name: Edge gallery mep installation pull chart # yamllint disable rule:line-length - command: helm install mep-edgegallery edgegallery/mep --set networkIsolation.phyInterface.mp1=eth1 --set networkIsolation.phyInterface.mm5=eth2 --set ssl.secretName=mep-ssl + command: helm install mep-edgegallery edgegallery/mep --set networkIsolation.phyInterface.mp1={{ vardata.interface1.name}} --set networkIsolation.phyInterface.mm5={{ vardata.interface2.name}} --set ssl.secretName=mep-ssl # yamllint disable rule:line-length args: chdir: /tmp/eg_mep/deploy/ diff --git a/ocd/infra/playbooks/roles/eg_mep/tasks/main.yml b/ocd/infra/playbooks/roles/eg_mep/tasks/main.yml index ff35318..70416a7 100644 --- a/ocd/infra/playbooks/roles/eg_mep/tasks/main.yml +++ b/ocd/infra/playbooks/roles/eg_mep/tasks/main.yml @@ -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 index 0000000..d64aa0d --- /dev/null +++ b/ocd/infra/playbooks/roles/eg_mep/tasks/uninstall.yml @@ -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 diff --git a/ocd/infra/playbooks/roles/eg_user-mgmt/tasks/main.yml b/ocd/infra/playbooks/roles/eg_user-mgmt/tasks/main.yml index 25db2e9..6545b6a 100644 --- a/ocd/infra/playbooks/roles/eg_user-mgmt/tasks/main.yml +++ b/ocd/infra/playbooks/roles/eg_user-mgmt/tasks/main.yml @@ -15,7 +15,12 @@ # --- + # tasks file for eg_user-mgmt - include: "install.yml" static: false when: operation == 'install' + +- include: "uninstall.yml" + static: false + when: operation == 'uninstall' diff --git a/ocd/infra/playbooks/roles/eg_user-mgmt/tasks/uninstall.yml b/ocd/infra/playbooks/roles/eg_user-mgmt/tasks/uninstall.yml new file mode 100644 index 0000000..a234fb4 --- /dev/null +++ b/ocd/infra/playbooks/roles/eg_user-mgmt/tasks/uninstall.yml @@ -0,0 +1,23 @@ +# +# 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 user management + command: helm uninstall user-mgmt-edgegallery + +- name: Uninstall user mngmt jwt + command: kubectl delete secret user-mgmt-jwt-secret diff --git a/ocd/infra/playbooks/roles/service_center/tasks/main.yml b/ocd/infra/playbooks/roles/service_center/tasks/main.yml index a91ab82..a79c680 100644 --- a/ocd/infra/playbooks/roles/service_center/tasks/main.yml +++ b/ocd/infra/playbooks/roles/service_center/tasks/main.yml @@ -20,3 +20,7 @@ - include: "install.yml" static: false when: operation == 'install' + +- include: "uninstall.yml" + static: false + when: operation == 'uninstall' diff --git a/ocd/infra/playbooks/roles/service_center/tasks/uninstall.yml b/ocd/infra/playbooks/roles/service_center/tasks/uninstall.yml new file mode 100644 index 0000000..0f5e128 --- /dev/null +++ b/ocd/infra/playbooks/roles/service_center/tasks/uninstall.yml @@ -0,0 +1,20 @@ +# +# 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 service center + command: helm uninstall service-center-edgegallery