eg_helm-repo install role added 66/3866/2
authorarvindpatel <arvind.patel@huawei.com>
Sun, 1 Nov 2020 19:06:50 +0000 (00:36 +0530)
committerarvindpatel <arvind.patel@huawei.com>
Sun, 1 Nov 2020 19:10:14 +0000 (00:40 +0530)
Signed-off-by: arvindpatel <arvind.patel@huawei.com>
Change-Id: Ic1db1eb909d67c0595e50c2036c753b4f6189189

ocd/infra/playbooks/roles/eg_helm-repo/tasks/install.yml [new file with mode: 0644]
ocd/infra/playbooks/roles/eg_helm-repo/tasks/main.yml [new file with mode: 0644]

diff --git a/ocd/infra/playbooks/roles/eg_helm-repo/tasks/install.yml b/ocd/infra/playbooks/roles/eg_helm-repo/tasks/install.yml
new file mode 100644 (file)
index 0000000..d64cc10
--- /dev/null
@@ -0,0 +1,57 @@
+#
+# 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: Doing deployment setup for edge gallery
+  copy:
+    src: deploy
+    dest: /tmp/eg_helm-repo/
+
+- name: Import vars
+  include_vars:
+    file: ../../../config.yml
+    name: vardata
+
+- name: Adding helm repo edgegallery
+  command: helm repo index edgegallery/
+  args:
+    chdir: /tmp/eg_helm-repo/deploy/helm/helm-charts/
+
+- name: Adding helm repo stable
+  command: helm repo index stable/
+  args:
+    chdir: /tmp/eg_helm-repo/deploy/helm/helm-charts/
+
+- name: Adding helm repo
+  # yamllint disable rule:line-length
+  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
+  # yamllint disable rule:line-length
+  args:
+    chdir: /tmp/eg_helm-repo/deploy/helm/helm-charts/
+
+- name: Add repo in adgegallery private IP
+  command: helm repo add edgegallery http://{{ vardata.helmrepoip.name}}:8080/edgegallery
+  args:
+    chdir: /tmp/eg_helm-repo/deploy/helm/helm-charts/
+
+- name: Add stable repo in given IP
+  command: helm repo add stable http://{{ vardata.helmrepoip.name}}:8080/stable
+  args:
+    chdir: /tmp/eg_helm-repo/deploy/helm/helm-charts/
+
+- debug:
+    msg: "Helm repo added successfully"
diff --git a/ocd/infra/playbooks/roles/eg_helm-repo/tasks/main.yml b/ocd/infra/playbooks/roles/eg_helm-repo/tasks/main.yml
new file mode 100644 (file)
index 0000000..52584d1
--- /dev/null
@@ -0,0 +1,26 @@
+#
+# 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_addrepo
+- include: "install.yml"
+  static: false
+  when: operation == 'install'
+
+- include: "uninstall.yml"
+  static: false
+  when: operation == 'uninstall'