f8550915e55baa2c23c33c06b550a5651aacb3f5
[eliot.git] / blueprints / iotgateway / playbooks / roles / helm / tasks / install.yml
1 # Copyright 2020 Huawei Technologies Co., Ltd.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #     http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 ---
15
16 - name: check whether helm is already installed
17   command: which helm
18   register: result
19   ignore_errors: yes
20   no_log: True
21
22 - debug:
23     msg: helm is already present
24   when: result.stdout != ""
25
26 - debug:
27 # yamllint disable rule:line-length
28     msg: Ignore Uninstall Log , Helm not installed continue with Installation
29 # yamllint disable rule:line-length
30   when: result.stdout == ""
31
32 - name: "INSTALL: Helm download command on x86_64"
33   command: wget https://get.helm.sh/helm-v3.0.2-linux-amd64.tar.gz
34   when: result is failed and ansible_architecture == 'x86_64'
35
36 - name: "INSTALL: Untar helm on x86_64"
37   command: tar -zxvf helm-v3.0.2-linux-amd64.tar.gz
38   when: result is failed and ansible_architecture == 'x86_64'
39
40 - name: "INSTALL: Helm move to bin folder on x86_64"
41   command: mv linux-amd64/helm /usr/local/bin/
42   when: result is failed and ansible_architecture == 'x86_64'
43
44 - name: "INSTALL: Helm download command on aarch64"
45   command: wget https://get.helm.sh/helm-v3.0.2-linux-arm64.tar.gz
46   when: result is failed and ansible_architecture == 'aarch64'
47
48 - name: "INSTALL: Untar helm on aarch64"
49   command: tar -zxvf helm-v3.0.2-linux-arm64.tar.gz
50   when: result is failed and ansible_architecture == 'aarch64'
51
52 - name: "INSTALL: Helm move to bin folder on aarch64"
53   command: mv linux-arm64/helm /usr/local/bin/
54   when: result is failed and ansible_architecture == 'aarch64'
55
56 - name: "INSTALL: Add helm repo"
57 # yamllint disable rule:line-length
58   command: helm repo add stable https://kubernetes-charts.storage.googleapis.com/
59 # yamllint disable rule:line-length
60   when: result is failed
61
62 - name: "INSTALL: Updated helm repo"
63   command: helm repo update
64   when: result is failed
65
66 - name: "INSTALLED List helm repo"
67   command: helm repo list
68   when: result is failed