5624146547ad88005cedd8d051bd0e4f2f87a351
[eliot.git] / blueprints / iotgateway / playbooks / roles / eg_helm-repo / 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: Doing deployment setup for edge gallery
20   copy:
21     src: deploy
22     dest: /tmp/eg_helm-repo/
23
24 - name: Import config file
25   include_vars:
26     file: ../../../config.yml
27     name: vardata
28
29 - name: Helm repo index edgegallery
30   command: helm repo index edgegallery/
31   args:
32     chdir: /tmp/eg_helm-repo/deploy/helm/helm-charts/
33
34 - name: Helm repo index stable
35   command: helm repo index stable/
36   args:
37     chdir: /tmp/eg_helm-repo/deploy/helm/helm-charts/
38
39 - name: Changing permisiion
40   command: chmod -R 755 /tmp/eg_helm-repo
41
42 - name: Creating helm repo
43   # yamllint disable rule:line-length
44   command: docker run --name helm-repo -v /tmp/eg_helm-repo/deploy/helm/helm-charts/:/usr/share/nginx/html:ro -d -p 8080:80 nginx:stable
45   args:
46     chdir: /tmp/eg_helm-repo/deploy/helm/helm-charts/
47
48 - name: Helm repo add edgegallery
49   # yamllint disable rule:line-length
50   command: helm repo add edgegallery http://{{ vardata.private_repo_ip.name}}:8080/edgegallery
51   args:
52     chdir: /tmp/eg_helm-repo/deploy/helm/helm-charts/
53
54 - name: Helm repo add stable
55   command: helm repo add stable http://{{ vardata.private_repo_ip.name}}:8080/stable
56   args:
57     chdir: /tmp/eg_helm-repo/deploy/helm/helm-charts/
58
59 - debug:
60     msg: "Helm repo created"