From: arvind.patel@huawei.com Date: Thu, 24 Dec 2020 12:05:03 +0000 (+0530) Subject: X86 env issue fixed X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=commitdiff_plain;h=647a4231f9bb695c309951b96e6004c2f7f38724;p=ealt-edge.git X86 env issue fixed Signed-off-by: arvind.patel@huawei.com Change-Id: Ic95f91894ce828a395d950b6538f31f9f19ccf4b --- diff --git a/ocd/infra/playbooks/config.yml b/ocd/infra/playbooks/config.yml index 16d0991..8b5dad3 100644 --- a/ocd/infra/playbooks/config.yml +++ b/ocd/infra/playbooks/config.yml @@ -85,3 +85,9 @@ mecm_meo_postgresAppoPassword: name: mecm_meo_postgresInventoryPassword: name: + +######### Optional keys for velero############## +velero_access_key: + name: minio +velero_secret_key: + name: minio123 diff --git a/ocd/infra/playbooks/ealt-all.yml b/ocd/infra/playbooks/ealt-all.yml index 026f5e4..988b947 100644 --- a/ocd/infra/playbooks/ealt-all.yml +++ b/ocd/infra/playbooks/ealt-all.yml @@ -28,6 +28,7 @@ - k8s - helm - docker + - eg_prerequisite - eg_registry - eg_helm-repo - eg_certs @@ -43,6 +44,7 @@ - center roles: + - eg_trans_certs - eg_prerequisite - helm - eg_set-helm-repo @@ -87,6 +89,7 @@ - edge roles: + - eg_trans_certs - docker - eg_prerequisite - k3s diff --git a/ocd/infra/playbooks/roles/docker/tasks/install.yml b/ocd/infra/playbooks/roles/docker/tasks/install.yml index c72fe26..119f675 100644 --- a/ocd/infra/playbooks/roles/docker/tasks/install.yml +++ b/ocd/infra/playbooks/roles/docker/tasks/install.yml @@ -67,6 +67,38 @@ ignore_errors: yes when: result is failed and ansible_architecture == 'aarch64' +- name: "INSTALL: Installing docker upgrade" +# yamllint disable rule:line-length + command: apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common +# yamllint disable rule:line-length + ignore_errors: yes + when: result is failed and ansible_architecture == 'x86_64' + +- name: "INSTALL: Add repository" + shell: curl -sL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - + when: result is failed and ansible_architecture == 'x86_64' + +- name: "INSTALL: CA-Certificates" +# yamllint disable rule:line-length + shell: sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" +# yamllint disable rule:line-length + ignore_errors: yes + failed_when: false + no_log: True + when: result is failed and ansible_architecture == 'x86_64' + +- name: "INSTALL: Update....." + command: apt-get update -y + ignore_errors: yes + failed_when: false + no_log: True + when: result is failed and ansible_architecture == 'x86_64' + +- name: "INSTALL: Installed docker" + command: apt-get install -y docker-ce docker-ce-cli containerd.io + ignore_errors: yes + when: result is failed and ansible_architecture == 'x86_64' + - debug: msg: "CentOS commands start" diff --git a/ocd/infra/playbooks/roles/eg_prerequisite/tasks/install.yml b/ocd/infra/playbooks/roles/eg_prerequisite/tasks/install.yml index 31c20a3..8511923 100644 --- a/ocd/infra/playbooks/roles/eg_prerequisite/tasks/install.yml +++ b/ocd/infra/playbooks/roles/eg_prerequisite/tasks/install.yml @@ -45,11 +45,3 @@ - name: Delete Execute script for docker daemon command: rm -rf /tmp/eg_prerequisite - -- name: Certificate copy - debug: - msg: Copy certificate from ocd to center and edge - -- synchronize: - src: /tmp/ssl-eg-keys-certs - dest: /tmp/ diff --git a/ocd/infra/playbooks/roles/eg_trans_certs/tasks/install.yml b/ocd/infra/playbooks/roles/eg_trans_certs/tasks/install.yml new file mode 100644 index 0000000..2207631 --- /dev/null +++ b/ocd/infra/playbooks/roles/eg_trans_certs/tasks/install.yml @@ -0,0 +1,25 @@ +# +# 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: Certificate copy + debug: + msg: Copy certificate from ocd to center and edge + +- synchronize: + src: /tmp/ssl-eg-keys-certs + dest: /tmp/ diff --git a/ocd/infra/playbooks/roles/eg_trans_certs/tasks/main.yml b/ocd/infra/playbooks/roles/eg_trans_certs/tasks/main.yml new file mode 100644 index 0000000..f67a423 --- /dev/null +++ b/ocd/infra/playbooks/roles/eg_trans_certs/tasks/main.yml @@ -0,0 +1,22 @@ +# +# 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_trans_certs +- include: "install.yml" + static: false + when: operation == 'install' diff --git a/ocd/infra/playbooks/roles/helm/tasks/install.yml b/ocd/infra/playbooks/roles/helm/tasks/install.yml index f855091..3ad5d11 100644 --- a/ocd/infra/playbooks/roles/helm/tasks/install.yml +++ b/ocd/infra/playbooks/roles/helm/tasks/install.yml @@ -55,7 +55,7 @@ - name: "INSTALL: Add helm repo" # yamllint disable rule:line-length - command: helm repo add stable https://kubernetes-charts.storage.googleapis.com/ + command: helm repo add stable https://charts.helm.sh/stable # yamllint disable rule:line-length when: result is failed diff --git a/ocd/infra/playbooks/roles/helm/tasks/uninstall.yml b/ocd/infra/playbooks/roles/helm/tasks/uninstall.yml index 78db3d1..08dfaf2 100644 --- a/ocd/infra/playbooks/roles/helm/tasks/uninstall.yml +++ b/ocd/infra/playbooks/roles/helm/tasks/uninstall.yml @@ -29,10 +29,14 @@ - name: "UNINSTALL: Helm Uninstall on x86_64" command: rm -rf linux-amd64/helm + ignore_errors: yes + no_log: True when: result is succeeded and ansible_architecture == 'x86_64' - name: "UNINSTALL: Remove download helm file on x86_64" command: rm ~/helm-v3.0.2-linux-amd64.tar.gz + ignore_errors: yes + no_log: True when: result is succeeded and ansible_architecture == 'x86_64' - name: "UNINSTALL: Helm Uninstall on aarch64" diff --git a/ocd/infra/playbooks/roles/prometheus/tasks/install.yml b/ocd/infra/playbooks/roles/prometheus/tasks/install.yml index baac580..4e222f2 100644 --- a/ocd/infra/playbooks/roles/prometheus/tasks/install.yml +++ b/ocd/infra/playbooks/roles/prometheus/tasks/install.yml @@ -35,11 +35,6 @@ # yamllint disable rule:line-length when: result.stdout == "" -- name: "INSTALL: Install prometheus on x86_64" - shell: - cmd: helm install mep-prometheus stable/prometheus --version v9.3.1 - when: result is failed and ansible_architecture == 'x86_64' - - name: "INSTALL: copy values.yaml to host" copy: src: values.yaml @@ -52,7 +47,6 @@ # yamllint disable rule:line-length ignore_errors: yes no_log: True - when: result is failed and ansible_architecture == 'aarch64' - name: Expose promethious server # yamllint disable rule:line-length diff --git a/ocd/infra/playbooks/roles/velero/files/credentials-velero b/ocd/infra/playbooks/roles/velero/files/credentials-velero new file mode 100644 index 0000000..48b5059 --- /dev/null +++ b/ocd/infra/playbooks/roles/velero/files/credentials-velero @@ -0,0 +1,4 @@ +[default] +aws_access_key_id=velero_access_key +aws_secret_access_key=velero_secret_key +EOF diff --git a/ocd/infra/playbooks/roles/velero/tasks/install.yml b/ocd/infra/playbooks/roles/velero/tasks/install.yml index c931bf4..8d19c68 100644 --- a/ocd/infra/playbooks/roles/velero/tasks/install.yml +++ b/ocd/infra/playbooks/roles/velero/tasks/install.yml @@ -33,6 +33,29 @@ # yamllint disable rule:line-length when: result.stdout == "" +- name: Doing deployment setup for edge gallery + copy: + src: credentials-velero + dest: /root/ + mode: 750 + +- name: Import config file + include_vars: + file: ../../../config.yml + name: vardata + +- name: Replacing access key + replace: + path: /root/credentials-velero + regexp: 'velero_access_key' + replace: "{{ vardata.velero_access_key.name }}" + +- name: Replacing secret key + replace: + path: /root/credentials-velero + regexp: 'velero_secret_key' + replace: "{{ vardata.velero_secret_key.name }}" + - name: Adding helm repo for velero command: helm repo add vmware-tanzu https://vmware-tanzu.github.io/helm-charts ignore_errors: yes diff --git a/ocd/infra/playbooks/roles/velero/tasks/main.yml b/ocd/infra/playbooks/roles/velero/tasks/main.yml index d8f70ba..0fa04da 100644 --- a/ocd/infra/playbooks/roles/velero/tasks/main.yml +++ b/ocd/infra/playbooks/roles/velero/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/velero/tasks/uninstall.yml b/ocd/infra/playbooks/roles/velero/tasks/uninstall.yml new file mode 100644 index 0000000..f4f7dd1 --- /dev/null +++ b/ocd/infra/playbooks/roles/velero/tasks/uninstall.yml @@ -0,0 +1,42 @@ +# +# 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: check if velero is already installed + shell: + cmd: kubectl get ns velero + register: result + ignore_errors: yes + no_log: True + +- debug: + msg: Unisntall velero + when: result.stdout != "" + +- debug: +# yamllint disable rule:line-length + msg: Ignore Uninstall Log , velero not installed +# yamllint disable rule:line-length + when: result.stdout == "" + +- name: Remove namespace for velero + command: kubectl delete ns velero + when: result is succeeded + +- name: Remove velero credentials file + command: rm /root/credentials-velero + when: result is succeeded