X86 env issue fixed
[ealt-edge.git] / ocd / infra / playbooks / roles / velero / tasks / install.yml
1 #
2 # Copyright 2020 Huawei Technologies Co., Ltd.
3 #
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
7 #
8 #     http://www.apache.org/licenses/LICENSE-2.0
9 #
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.
15 #
16
17 ---
18
19 - name: check if velero is already installed
20   shell:
21     cmd: kubectl get pods -n velero
22   register: result
23   ignore_errors: yes
24   no_log: True
25
26 - debug:
27     msg: velero already installed
28   when: result.stdout != ""
29
30 - debug:
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 == ""
35
36 - name: Doing deployment setup for edge gallery
37   copy:
38     src: credentials-velero
39     dest: /root/
40     mode: 750
41
42 - name: Import config file
43   include_vars:
44     file: ../../../config.yml
45     name: vardata
46
47 - name: Replacing access key
48   replace:
49     path: /root/credentials-velero
50     regexp: 'velero_access_key'
51     replace: "{{ vardata.velero_access_key.name }}"
52
53 - name: Replacing secret key
54   replace:
55     path: /root/credentials-velero
56     regexp: 'velero_secret_key'
57     replace: "{{ vardata.velero_secret_key.name }}"
58
59 - name: Adding helm repo for velero
60   command: helm repo add vmware-tanzu https://vmware-tanzu.github.io/helm-charts
61   ignore_errors: yes
62   no_log: True
63   when: result.stdout == ""
64
65 - name: Create name space for velero
66   command: kubectl create ns velero
67   ignore_errors: yes
68   no_log: True
69   when: result.stdout == ""
70
71 - name: Install velero
72   # yamllint disable rule:line-length
73   shell:
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 == ""