From e8dd6f7523a59c39eb9f573e5f44afb2dc327a6a Mon Sep 17 00:00:00 2001 From: arvindpatel Date: Mon, 2 Nov 2020 00:36:50 +0530 Subject: [PATCH] eg_helm-repo install role added Signed-off-by: arvindpatel Change-Id: Ic1db1eb909d67c0595e50c2036c753b4f6189189 --- .../playbooks/roles/eg_helm-repo/tasks/install.yml | 57 ++++++++++++++++++++++ .../playbooks/roles/eg_helm-repo/tasks/main.yml | 26 ++++++++++ 2 files changed, 83 insertions(+) create mode 100644 ocd/infra/playbooks/roles/eg_helm-repo/tasks/install.yml create mode 100644 ocd/infra/playbooks/roles/eg_helm-repo/tasks/main.yml 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 index 0000000..d64cc10 --- /dev/null +++ b/ocd/infra/playbooks/roles/eg_helm-repo/tasks/install.yml @@ -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 index 0000000..52584d1 --- /dev/null +++ b/ocd/infra/playbooks/roles/eg_helm-repo/tasks/main.yml @@ -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' -- 2.16.6