name:
mecm_meo_postgresInventoryPassword:
name:
+
+######### Optional keys for velero##############
+velero_access_key:
+ name: minio
+velero_secret_key:
+ name: minio123
- k8s
- helm
- docker
+ - eg_prerequisite
- eg_registry
- eg_helm-repo
- eg_certs
- center
roles:
+ - eg_trans_certs
- eg_prerequisite
- helm
- eg_set-helm-repo
- edge
roles:
+ - eg_trans_certs
- docker
- eg_prerequisite
- k3s
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"
- 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/
--- /dev/null
+#
+# 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/
--- /dev/null
+#
+# 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'
- 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
- 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"
# 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
# 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
--- /dev/null
+[default]
+aws_access_key_id=velero_access_key
+aws_secret_access_key=velero_secret_key
+EOF
# 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
- include: "install.yml"
static: false
when: operation == 'install'
+
+- include: "uninstall.yml"
+ static: false
+ when: operation == 'uninstall'
--- /dev/null
+#
+# 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