From 3c1bb1c727ca416486ab96384557ee3d12acf1e9 Mon Sep 17 00:00:00 2001 From: Srinivasan Date: Mon, 7 Jun 2021 16:05:48 +0530 Subject: [PATCH] munomode Signed-off-by: Srinivasan Change-Id: If9ff0a21995c6558167acd4e92ef696a3cf10d90 --- ...muno-latest.yml => ealt-eg-muno-controller.yml} | 3 +- ocd/infra/playbooks/ealt-eg-muno-edge.yml | 26 ++++++++++ .../controller/hosts-muno-controller} | 5 +- ocd/infra/playbooks/muno-config/controller/var.yml | 33 ++++++++++++ .../playbooks/muno-config/edge/hosts-muno-edge | 20 ++++++++ ocd/infra/playbooks/muno-config/edge/var.yml | 37 +++++++++++++ .../roles/egallery-all-aiomode/tasks/uninstall.yml | 4 +- .../egallery-munomode-controller/tasks/install.yml | 60 ++++++++++++++++++++++ .../tasks/main.yml | 2 +- .../tasks/uninstall.yml} | 18 +++---- .../roles/egallery-munomode-edge/tasks/install.yml | 52 +++++++++++++++++++ .../roles/egallery-munomode-edge/tasks/main.yml | 23 +++++++++ .../tasks/uninstall.yml | 19 +++---- 13 files changed, 271 insertions(+), 31 deletions(-) rename ocd/infra/playbooks/{ealt-eg-muno-latest.yml => ealt-eg-muno-controller.yml} (93%) create mode 100644 ocd/infra/playbooks/ealt-eg-muno-edge.yml rename ocd/infra/playbooks/{hosts-muno => muno-config/controller/hosts-muno-controller} (95%) create mode 100644 ocd/infra/playbooks/muno-config/controller/var.yml create mode 100644 ocd/infra/playbooks/muno-config/edge/hosts-muno-edge create mode 100644 ocd/infra/playbooks/muno-config/edge/var.yml create mode 100644 ocd/infra/playbooks/roles/egallery-munomode-controller/tasks/install.yml rename ocd/infra/playbooks/roles/{egallery-all-munomode => egallery-munomode-controller}/tasks/main.yml (96%) rename ocd/infra/playbooks/roles/{egallery-all-munomode/tasks/install.yml => egallery-munomode-controller/tasks/uninstall.yml} (57%) create mode 100644 ocd/infra/playbooks/roles/egallery-munomode-edge/tasks/install.yml create mode 100644 ocd/infra/playbooks/roles/egallery-munomode-edge/tasks/main.yml rename ocd/infra/playbooks/roles/{egallery-all-munomode => egallery-munomode-edge}/tasks/uninstall.yml (55%) diff --git a/ocd/infra/playbooks/ealt-eg-muno-latest.yml b/ocd/infra/playbooks/ealt-eg-muno-controller.yml similarity index 93% rename from ocd/infra/playbooks/ealt-eg-muno-latest.yml rename to ocd/infra/playbooks/ealt-eg-muno-controller.yml index bd44815..5b7c856 100644 --- a/ocd/infra/playbooks/ealt-eg-muno-latest.yml +++ b/ocd/infra/playbooks/ealt-eg-muno-controller.yml @@ -21,5 +21,4 @@ - hosts: master become: yes roles: - - egallery-tar - - egallery-all-munomode + - egallery-munomode-controller diff --git a/ocd/infra/playbooks/ealt-eg-muno-edge.yml b/ocd/infra/playbooks/ealt-eg-muno-edge.yml new file mode 100644 index 0000000..757b3fc --- /dev/null +++ b/ocd/infra/playbooks/ealt-eg-muno-edge.yml @@ -0,0 +1,26 @@ +# +# Copyright 2021 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. +# + +--- + +# playbook file for EG-MUNO + +- hosts: master + become: yes + vars_files: + - ./muno-config/edge/var.yml + roles: + - egallery-munomode-edge diff --git a/ocd/infra/playbooks/hosts-muno b/ocd/infra/playbooks/muno-config/controller/hosts-muno-controller similarity index 95% rename from ocd/infra/playbooks/hosts-muno rename to ocd/infra/playbooks/muno-config/controller/hosts-muno-controller index c0ed94b..9aa92f1 100644 --- a/ocd/infra/playbooks/hosts-muno +++ b/ocd/infra/playbooks/muno-config/controller/hosts-muno-controller @@ -14,7 +14,4 @@ # limitations under the License. [master] -master-ip - -[worker] -worker-ip +controller-ip diff --git a/ocd/infra/playbooks/muno-config/controller/var.yml b/ocd/infra/playbooks/muno-config/controller/var.yml new file mode 100644 index 0000000..29fe1fb --- /dev/null +++ b/ocd/infra/playbooks/muno-config/controller/var.yml @@ -0,0 +1,33 @@ +# +# Copyright 2021 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. + +# Set the Password of Harbor admin account, no default value, +# must set by users here +HARBOR_ADMIN_PASSWORD: any_password + +# Could be true or false +# true: Deploy k8s NFS Server to keep the persistence of all pods' data +# false: No need to keep the persistence of all pods' data + +# ENABLE_PERSISTENCE: true +ENABLE_PERSISTENCE: false + + + +# ip for portals, will be set to private IP of master node default or +# reset it to be the public IP of master node here +# PORTAL_IP: xxx.xxx.xxx.xxx +PORTAL_IP: IP_master_node + diff --git a/ocd/infra/playbooks/muno-config/edge/hosts-muno-edge b/ocd/infra/playbooks/muno-config/edge/hosts-muno-edge new file mode 100644 index 0000000..a63edb4 --- /dev/null +++ b/ocd/infra/playbooks/muno-config/edge/hosts-muno-edge @@ -0,0 +1,20 @@ +# +# Copyright 2021 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. + +[master] +edge-ip-1 +edge-ip-2 + +# Here you can add edge nodes diff --git a/ocd/infra/playbooks/muno-config/edge/var.yml b/ocd/infra/playbooks/muno-config/edge/var.yml new file mode 100644 index 0000000..576eef1 --- /dev/null +++ b/ocd/infra/playbooks/muno-config/edge/var.yml @@ -0,0 +1,37 @@ +# +# Copyright 2021 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. + +# Set the Password of Harbor admin account, no default value, +# must set by users here +HARBOR_ADMIN_PASSWORD: Harbor@edge + +# Could be true or false +# true: Deploy k8s NFS Server to keep the persistence of all pods' data +# false: No need to keep the persistence of all pods' data +ENABLE_PERSISTENCE: false + +# ip for portals, will be set to private IP of master node default or +# reset it to be the public IP of master node here +# PORTAL_IP: xxx.xxx.xxx.xxx + +# NIC name of master node +# If master node is with single NIC, not need to set it here and will get +# the default NIC name during the run time +# If master node is with multiple NICs, should set it here to be +# 2 different NICs +# EG_NODE_EDGE_MP1: eth0 +# EG_NODE_EDGE_MM5: eth0 + +OCD_IP: 10.0.0.33 diff --git a/ocd/infra/playbooks/roles/egallery-all-aiomode/tasks/uninstall.yml b/ocd/infra/playbooks/roles/egallery-all-aiomode/tasks/uninstall.yml index 81bb1a1..6896328 100644 --- a/ocd/infra/playbooks/roles/egallery-all-aiomode/tasks/uninstall.yml +++ b/ocd/infra/playbooks/roles/egallery-all-aiomode/tasks/uninstall.yml @@ -16,7 +16,7 @@ - name: Uninstall edgegallery on arm shell: # yamllint disable rule:line-length - cmd: ansible-playbook --inventory hosts-aio eg_all_muno_uninstall.yml -e "ansible_user=root" >> aio_remove.log + cmd: ansible-playbook --inventory hosts-aio eg_all_aio_uninstall.yml -e "ansible_user=root" >> aio_remove.log # yamllint disable rule:line-length chdir: /tmp/eg_download/deploy/ansible-all-arm-latest/install when: ansible_architecture == 'aarch64' @@ -24,7 +24,7 @@ - name: Uninstall edgegallery on x86 shell: # yamllint disable rule:line-length - cmd: ansible-playbook --inventory hosts-aio eg_all_muno_uninstall.yml -e "ansible_user=root" >> aio_remove.log + cmd: ansible-playbook --inventory hosts-aio eg_all_aio_uninstall.yml -e "ansible_user=root" >> aio_remove.log # yamllint disable rule:line-length chdir: /tmp/eg_download/deploy/ansible-all-x86-latest/install when: ansible_architecture == 'x86_64' diff --git a/ocd/infra/playbooks/roles/egallery-munomode-controller/tasks/install.yml b/ocd/infra/playbooks/roles/egallery-munomode-controller/tasks/install.yml new file mode 100644 index 0000000..3559511 --- /dev/null +++ b/ocd/infra/playbooks/roles/egallery-munomode-controller/tasks/install.yml @@ -0,0 +1,60 @@ +# Copyright 2021 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 MUNO controller + +### MUNO controller installation ### + +- name: Create directory to download EG-TAR + command: mkdir -p /tmp/eg_download/deploy + args: + chdir: "{{playbook_dir}}" + ignore_errors: yes + +- name: Download 1.1 edgegallery x86 controller +# yamllint disable rule:line-length + command: wget https://edgegallery.obs.cn-east-3.myhuaweicloud.com/releases/v1.1.1/x86/EdgeGallery-v1.1.1-controller-x86.tar.gz +# yamllint disable rule:line-length + args: + chdir: /tmp/eg_download/deploy/ + when: ansible_architecture == 'x86_64' + +- name: Untar Edgegallery offline controller tar file + command: tar -xvf EdgeGallery-v1.1.1-controller-x86 + args: + chdir: /tmp/eg_download/deploy/ + when: ansible_architecture == 'x86_64' + +- name: Set inventory file for muno controller +# yamllint disable rule:line-length + command: cp muno-config/controller/hosts-muno-controller /tmp/eg_download/deploy/EdgeGallery-v1.1.1-controller-x86/install +# yamllint disable rule:line-length + args: + chdir: "{{playbook_dir}}" + +- name: Set var.yml file for muno controller +# yamllint disable rule:line-length + command: cp muno-config/controller/var.yml /tmp/eg_download/deploy/EdgeGallery-v1.1.1-controller-x86/install +# yamllint disable rule:line-length + args: + chdir: /tmp/eg_download/deploy/EdgeGallery-v1.1.1-edge-x86/install + +- name: Install edgegallery controller + shell: + # yamllint disable rule:line-length + cmd: ansible-playbook --inventory hosts-muno-controller -e "ansible_user=root" eg_controller_aio_install.yml >> muno_controller_log + # yamllint disable rule:line-length + chdir: /tmp/eg_download/deploy/EdgeGallery-v1.1.1-controller-x86/install + when: ansible_architecture == 'x86_64' diff --git a/ocd/infra/playbooks/roles/egallery-all-munomode/tasks/main.yml b/ocd/infra/playbooks/roles/egallery-munomode-controller/tasks/main.yml similarity index 96% rename from ocd/infra/playbooks/roles/egallery-all-munomode/tasks/main.yml rename to ocd/infra/playbooks/roles/egallery-munomode-controller/tasks/main.yml index 063f2ac..3139a32 100644 --- a/ocd/infra/playbooks/roles/egallery-all-munomode/tasks/main.yml +++ b/ocd/infra/playbooks/roles/egallery-munomode-controller/tasks/main.yml @@ -13,7 +13,7 @@ # limitations under the License. --- -# tasks file for eg muno all +# tasks file for eg muno mode - include: "install.yml" static: false when: operation == 'install' diff --git a/ocd/infra/playbooks/roles/egallery-all-munomode/tasks/install.yml b/ocd/infra/playbooks/roles/egallery-munomode-controller/tasks/uninstall.yml similarity index 57% rename from ocd/infra/playbooks/roles/egallery-all-munomode/tasks/install.yml rename to ocd/infra/playbooks/roles/egallery-munomode-controller/tasks/uninstall.yml index fb19c16..75ca312 100644 --- a/ocd/infra/playbooks/roles/egallery-all-munomode/tasks/install.yml +++ b/ocd/infra/playbooks/roles/egallery-munomode-controller/tasks/uninstall.yml @@ -13,19 +13,17 @@ # limitations under the License. --- -# tasks file for MUNO mode -- name: Install edgegallery + +- name: Uninstall edgegallery controller on x86 shell: # yamllint disable rule:line-length - cmd: ansible-playbook --inventory hosts-aio -e "ansible_user=root" eg_all_muno_install.yml >> muno_log + cmd: ansible-playbook --inventory hosts-muno-controller eg_controller_aio_uninstall.yml -e "ansible_user=root" >> muno_controller_remove.log # yamllint disable rule:line-length - chdir: /tmp/eg_download/deploy/ansible-all-arm-latest/install - when: ansible_architecture == 'aarch64' + chdir: /tmp/eg_download/deploy/EdgeGallery-v1.1.1-controller-x86/install + when: ansible_architecture == 'x86_64' -- name: Install edgegallery +- name: Remove edgegallery tar ball shell: - # yamllint disable rule:line-length - cmd: ansible-playbook --inventory hosts-aio -e "ansible_user=root" eg_all_muno_install.yml >> muno_log - # yamllint disable rule:line-length - chdir: /tmp/eg_download/deploy/ansible-all-x86-latest/install + cmd: rm -rf EdgeGallery-v1.1.1-* + chdir: /tmp/eg_download/deploy/ when: ansible_architecture == 'x86_64' diff --git a/ocd/infra/playbooks/roles/egallery-munomode-edge/tasks/install.yml b/ocd/infra/playbooks/roles/egallery-munomode-edge/tasks/install.yml new file mode 100644 index 0000000..1edac16 --- /dev/null +++ b/ocd/infra/playbooks/roles/egallery-munomode-edge/tasks/install.yml @@ -0,0 +1,52 @@ +# Copyright 2021 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. + +--- +### MUNO edge installation ### + +- name: Download 1.1 edgegallery x86 edge +# yamllint disable rule:line-length + command: wget https://edgegallery.obs.cn-east-3.myhuaweicloud.com/releases/v1.1.1/x86/EdgeGallery-v1.1.1-edge-x86.tar.gz +# yamllint disable rule:line-length + args: + chdir: /tmp/eg_download/deploy/ + when: ansible_architecture == 'x86_64' + +- name: Untar Edgegallery offline edge tar file + command: tar -xvf EdgeGallery-v1.1.1-edge-x86 + args: + chdir: /tmp/eg_download/deploy/ + when: ansible_architecture == 'x86_64' + +- name: Set inventory file for muno edge +# yamllint disable rule:line-length + command: scp root@{{ OCD_IP }}:"{{playbook_dir}}"/muno-config/edge/hosts-muno-edge . +# yamllint disable rule:line-length + args: + chdir: /tmp/eg_download/deploy/EdgeGallery-v1.1.1-edge-x86/install + +- name: Set var.yml file for muno edge +# yamllint disable rule:line-length + command: scp root@{{ OCD_IP }}:"{{playbook_dir}}"/muno-config/edge/var.yml . +# yamllint disable rule:line-length + args: + chdir: /tmp/eg_download/deploy/EdgeGallery-v1.1.1-edge-x86/install + +- name: Install edgegallery edge + shell: + # yamllint disable rule:line-length + cmd: ansible-playbook --inventory hosts-muno-edge -e "ansible_user=root" eg_edge_aio_install.yml >> muno_edge_log + # yamllint disable rule:line-length + chdir: /tmp/eg_download/deploy/EdgeGallery-v1.1.1-edge-x86/install + when: ansible_architecture == 'x86_64' diff --git a/ocd/infra/playbooks/roles/egallery-munomode-edge/tasks/main.yml b/ocd/infra/playbooks/roles/egallery-munomode-edge/tasks/main.yml new file mode 100644 index 0000000..3139a32 --- /dev/null +++ b/ocd/infra/playbooks/roles/egallery-munomode-edge/tasks/main.yml @@ -0,0 +1,23 @@ +# Copyright 2021 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 muno mode +- include: "install.yml" + static: false + when: operation == 'install' + +- include: "uninstall.yml" + static: false + when: operation == 'uninstall' diff --git a/ocd/infra/playbooks/roles/egallery-all-munomode/tasks/uninstall.yml b/ocd/infra/playbooks/roles/egallery-munomode-edge/tasks/uninstall.yml similarity index 55% rename from ocd/infra/playbooks/roles/egallery-all-munomode/tasks/uninstall.yml rename to ocd/infra/playbooks/roles/egallery-munomode-edge/tasks/uninstall.yml index cf32329..71274da 100644 --- a/ocd/infra/playbooks/roles/egallery-all-munomode/tasks/uninstall.yml +++ b/ocd/infra/playbooks/roles/egallery-munomode-edge/tasks/uninstall.yml @@ -13,23 +13,18 @@ # limitations under the License. --- -- name: Uninstall edgegallery on arm - shell: - # yamllint disable rule:line-length - cmd: ansible-playbook --inventory hosts-aio eg_all_muno_uninstall.yml -e "ansible_user=root" >> aio_remove.log - # yamllint disable rule:line-length - chdir: /tmp/eg_download/deploy/ansible-all-arm-latest/install - when: ansible_architecture == 'aarch64' +# uninstallation of edge -- name: Uninstall edgegallery on x86 +- name: Uninstall edgegallery edge on x86 shell: # yamllint disable rule:line-length - cmd: ansible-playbook --inventory hosts-aio eg_all_muno_uninstall.yml -e "ansible_user=root" >> aio_remove.log + cmd: ansible-playbook --inventory hosts-muno-edge eg_edge_aio_uninstall.yml -e "ansible_user=root" >> muno_edge_remove.log # yamllint disable rule:line-length - chdir: /tmp/eg_download/deploy/ansible-all-x86-latest/install + chdir: /tmp/eg_download/deploy/EdgeGallery-v1.1.1-edge-x86/install when: ansible_architecture == 'x86_64' -- name: Remove muno log +- name: Remove edgegallery tar ball shell: - cmd: rm -rf muno_log + cmd: rm -rf EdgeGallery-v1.1.1-* chdir: /tmp/eg_download/deploy/ + when: ansible_architecture == 'x86_64' -- 2.16.6