X86 env issue fixed 08/4008/10
authorarvind.patel@huawei.com <arvind.patel@huawei.com>
Thu, 24 Dec 2020 12:05:03 +0000 (17:35 +0530)
committerkhemendra kumar <khemendra.kumar@huawei.com>
Thu, 31 Dec 2020 06:44:15 +0000 (06:44 +0000)
Signed-off-by: arvind.patel@huawei.com <arvind.patel@huawei.com>
Change-Id: Ic95f91894ce828a395d950b6538f31f9f19ccf4b

13 files changed:
ocd/infra/playbooks/config.yml
ocd/infra/playbooks/ealt-all.yml
ocd/infra/playbooks/roles/docker/tasks/install.yml
ocd/infra/playbooks/roles/eg_prerequisite/tasks/install.yml
ocd/infra/playbooks/roles/eg_trans_certs/tasks/install.yml [new file with mode: 0644]
ocd/infra/playbooks/roles/eg_trans_certs/tasks/main.yml [new file with mode: 0644]
ocd/infra/playbooks/roles/helm/tasks/install.yml
ocd/infra/playbooks/roles/helm/tasks/uninstall.yml
ocd/infra/playbooks/roles/prometheus/tasks/install.yml
ocd/infra/playbooks/roles/velero/files/credentials-velero [new file with mode: 0644]
ocd/infra/playbooks/roles/velero/tasks/install.yml
ocd/infra/playbooks/roles/velero/tasks/main.yml
ocd/infra/playbooks/roles/velero/tasks/uninstall.yml [new file with mode: 0644]

index 16d0991..8b5dad3 100644 (file)
@@ -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
index 026f5e4..988b947 100644 (file)
@@ -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
index c72fe26..119f675 100644 (file)
   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"
 
index 31c20a3..8511923 100644 (file)
 
 - 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 (file)
index 0000000..2207631
--- /dev/null
@@ -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 (file)
index 0000000..f67a423
--- /dev/null
@@ -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'
index f855091..3ad5d11 100644 (file)
@@ -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
 
index 78db3d1..08dfaf2 100644 (file)
 
 - 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"
index baac580..4e222f2 100644 (file)
 # 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 (file)
index 0000000..48b5059
--- /dev/null
@@ -0,0 +1,4 @@
+[default]
+aws_access_key_id=velero_access_key
+aws_secret_access_key=velero_secret_key
+EOF
index c931bf4..8d19c68 100644 (file)
 # 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
index d8f70ba..0fa04da 100644 (file)
@@ -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 (file)
index 0000000..f4f7dd1
--- /dev/null
@@ -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