From: arvind.patel@huawei.com Date: Thu, 10 Dec 2020 06:45:27 +0000 (+0530) Subject: Influx and openebs X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=commitdiff_plain;h=c1032d7bbe706e2459d16ffe6482a5eb44006a7b;p=ealt-edge.git Influx and openebs Signed-off-by: arvind.patel@huawei.com Change-Id: I7af910407ba69921453fbbe7a19858a8d7136e93 --- diff --git a/ocd/infra/playbooks/ealt-all-uninstall.yml b/ocd/infra/playbooks/ealt-all-uninstall.yml index d1eb485..e6231c1 100644 --- a/ocd/infra/playbooks/ealt-all-uninstall.yml +++ b/ocd/infra/playbooks/ealt-all-uninstall.yml @@ -89,15 +89,14 @@ ### Storage ### -#- hosts: openebsinfluxdb -# become: yes -# tags: -# - ealt_ebs_influx -# - edge - -# roles: -# - influxdb -# - openebsrole +- hosts: openebsinfluxdb + become: yes + tags: + - ealt_ebs_influx + - edge + + roles: + - influxdb ### Pre-Requisites ### diff --git a/ocd/infra/playbooks/ealt-all.yml b/ocd/infra/playbooks/ealt-all.yml index 0381e55..296ad58 100644 --- a/ocd/infra/playbooks/ealt-all.yml +++ b/ocd/infra/playbooks/ealt-all.yml @@ -133,12 +133,12 @@ ### Storage ### -#- hosts: openebsinfluxdb -# become: yes -# tags: -# - ealt_ebs_influx -# - edge - -# roles: -# - influxdb -# - openebsrole +- hosts: openebsinfluxdb + become: yes + tags: + - ealt_ebs_influx + - edge + + roles: + - influxdb + - openebsrole diff --git a/ocd/infra/playbooks/roles/influxdb/tasks/install.yml b/ocd/infra/playbooks/roles/influxdb/tasks/install.yml index c0c856d..3b0d938 100644 --- a/ocd/infra/playbooks/roles/influxdb/tasks/install.yml +++ b/ocd/infra/playbooks/roles/influxdb/tasks/install.yml @@ -16,13 +16,13 @@ --- -- name: "INSTALL: Install influxdata by helm charts" +- name: "INSTALL: Installing influxdata" shell: cmd: helm repo add influxdata https://influxdata.github.io/helm-charts ignore_errors: yes no_log: True -- name: "INSTALL: Deploye influxdata" +- name: "INSTALL: Install infuxdb" shell: cmd: helm upgrade -i influxdb influxdata/influxdb --set image.tag=1.8.0 ignore_errors: yes diff --git a/ocd/infra/playbooks/roles/influxdb/tasks/uninstall.yml b/ocd/infra/playbooks/roles/influxdb/tasks/uninstall.yml index b8fa456..2b7ed67 100644 --- a/ocd/infra/playbooks/roles/influxdb/tasks/uninstall.yml +++ b/ocd/infra/playbooks/roles/influxdb/tasks/uninstall.yml @@ -16,7 +16,7 @@ --- -- name: Uninstalling influxdb +- name: Uninstall influxdb shell: cmd: helm uninstall influxdb ignore_errors: yes diff --git a/ocd/infra/playbooks/roles/openebsrole/tasks/install.yml b/ocd/infra/playbooks/roles/openebsrole/tasks/install.yml index b34d108..9628b8d 100644 --- a/ocd/infra/playbooks/roles/openebsrole/tasks/install.yml +++ b/ocd/infra/playbooks/roles/openebsrole/tasks/install.yml @@ -16,27 +16,47 @@ --- -- name: "create namespace openebs" +- name: check if openebs is already installed + shell: + cmd: kubectl get pods -n openebs + register: result + ignore_errors: yes + no_log: True + +- debug: + msg: openebs already installed + when: result.stdout != "" + +- debug: +# yamllint disable rule:line-length + msg: Ignore Uninstall Log , Openebs not installed continue with Installation +# yamllint disable rule:line-length + when: result.stdout == "" + +- name: "INSTALL: create namespace for openebs" shell: cmd: kubectl create ns openebs ignore_errors: yes no_log: True + when: result.stdout == "" -- name: "INSTALL: add helm repo add aarch64" +- name: "INSTALL: add helm repo for openebs" shell: cmd: helm repo add openebs https://openebs.github.io/charts ignore_errors: yes no_log: True + when: result.stdout == "" -- name: "INSTALL: helm repo update aarch64" +- name: "INSTALL: update helm repo" shell: cmd: helm repo update ignore_errors: yes no_log: True + when: result.stdout == "" -- name: "INSTALL: Install on Openebs aarch64" +- name: "INSTALL: install openebs" shell: - # yamllint disable rule:line-length - cmd: helm install --namespace openebs --generate-name openebs --version 2.3.0 + cmd: helm install openebs --namespace openebs openebs/openebs ignore_errors: yes no_log: True + when: result.stdout == "" diff --git a/ocd/infra/playbooks/roles/openebsrole/tasks/main.yml b/ocd/infra/playbooks/roles/openebsrole/tasks/main.yml index 51b1c39..c5dcaf0 100644 --- a/ocd/infra/playbooks/roles/openebsrole/tasks/main.yml +++ b/ocd/infra/playbooks/roles/openebsrole/tasks/main.yml @@ -15,13 +15,8 @@ # --- - -# tasks file for sample-rolename +# tasks file for openebs - include: "install.yml" static: false when: operation == 'install' - -- include: "uninstall.yml" - static: false - when: operation == 'uninstall' diff --git a/ocd/infra/playbooks/roles/openebsrole/tasks/uninstall.yml b/ocd/infra/playbooks/roles/openebsrole/tasks/uninstall.yml deleted file mode 100644 index 61f6548..0000000 --- a/ocd/infra/playbooks/roles/openebsrole/tasks/uninstall.yml +++ /dev/null @@ -1,23 +0,0 @@ -# -# 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: Uninstall openebs - shell: - cmd: kubectl delete ns openebs - ignore_errors: yes - no_log: True