2 # Copyright 2020 Huawei Technologies Co., Ltd.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
19 - name: check if velero is already installed
21 cmd: kubectl get pods -n velero
27 msg: velero already installed
28 when: result.stdout != ""
31 # yamllint disable rule:line-length
32 msg: Ignore Uninstall Log , velero not installed continue with Installation
33 # yamllint disable rule:line-length
34 when: result.stdout == ""
36 - name: Doing deployment setup for edge gallery
38 src: credentials-velero
42 - name: Import config file
44 file: ../../../config.yml
47 - name: Replacing access key
49 path: /root/credentials-velero
50 regexp: 'velero_access_key'
51 replace: "{{ vardata.velero_access_key.name }}"
53 - name: Replacing secret key
55 path: /root/credentials-velero
56 regexp: 'velero_secret_key'
57 replace: "{{ vardata.velero_secret_key.name }}"
59 - name: Adding helm repo for velero
60 command: helm repo add vmware-tanzu https://vmware-tanzu.github.io/helm-charts
63 when: result.stdout == ""
65 - name: Create name space for velero
66 command: kubectl create ns velero
69 when: result.stdout == ""
71 - name: Install velero
72 # yamllint disable rule:line-length
74 cmd: helm install vmware-tanzu/velero --namespace velero --set-file credentials.secretContents.cloud=./credentials-velero --set configuration.provider=aws --set configuration.backupStorageLocation.name= default --set configuration.backupStorageLocation.bucket=newbucket > --set configuration.backupStorageLocation.config.region=minio > --set configuration.volumeSnapshotLocation.name=default > --set configuration.volumeSnapshotLocation.config.region=minio > --set image.repository=velero/velero > --set image.tag=v1.5.1 > --set image.pullPolicy=IfNotPresent> --set initContainers[0].name=velero-plugin-for-aws > --set initContainers[0].image=velero/velero-plugin-for-aws:v1.1.0 > --set initContainers[0].volumeMounts[0].mountPath=/target > --set initContainers[0].volumeMounts[0].name=plugins --generate-name =velero
75 when: result.stdout == ""