From 1e343febbbd958143ad29e4feb4a31baca01e981 Mon Sep 17 00:00:00 2001 From: Todd Malsbary Date: Wed, 31 Mar 2021 13:34:22 -0700 Subject: Replace emco with openness-21.03 release This change also installs emcoctl in the artifacts directory, similar to what is done for kubectl by kubespray. Issue-ID: MULTICLOUD-1324 Signed-off-by: Todd Malsbary Change-Id: I8447210487578ceeef61afc7c3e4d97905303c8a --- .../playbooks/configure-emco-reset.yml | 50 ++++++++++++---------- 1 file changed, 27 insertions(+), 23 deletions(-) (limited to 'kud/deployment_infra/playbooks/configure-emco-reset.yml') diff --git a/kud/deployment_infra/playbooks/configure-emco-reset.yml b/kud/deployment_infra/playbooks/configure-emco-reset.yml index 7cad36e4..d13bb9e7 100644 --- a/kud/deployment_infra/playbooks/configure-emco-reset.yml +++ b/kud/deployment_infra/playbooks/configure-emco-reset.yml @@ -8,40 +8,44 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## -- hosts: kube-master +- hosts: localhost + become: yes tasks: - name: Load kud variables include_vars: file: kud-vars.yml - - name: Change the emco directory and run helm delete - command: /usr/local/bin/helm uninstall --namespace emco emco - register: helm_delete - args: - chdir: /opt/multicloud/deployments/helm/v2/emco + - name: Check if emco is installed + command: /usr/local/bin/helm -n emco list + register: helm_list - - debug: - var: helm_delete.stdout_lines + - name: Set helm_installed fact + set_fact: + helm_installed: "{{ helm_list.stdout | regex_findall('^\\S+', multiline=True) }}" - - name: Change the emco directory and delete the emco namespace - command: /usr/local/bin/kubectl delete ns emco - register: delete_emco_ns - args: - chdir: /opt/multicloud/deployments/helm/v2/emco + - name: Uninstall monitor helm chart + command: /usr/local/bin/helm uninstall --namespace emco monitor + when: '"monitor" in helm_installed' - - debug: - var: delete_emco_ns.stdout_lines + - name: Uninstall emco helm charts + command: /usr/local/bin/helm uninstall --namespace emco emco + when: '"emco" in helm_installed' - - name: Change the emco directory and make clean + - name: Change to the emco directory and delete the emco namespace + command: /usr/local/bin/kubectl delete ns emco --ignore-not-found=true + + - name: Check if emco directory exists + stat: + path: "{{ emco_dir }}" + register: emco_dir_stat + + - name: Change to the emco directory and make clean command: /usr/bin/make clean - register: make_clean args: - chdir: /opt/multicloud/deployments/helm/v2/emco - - - debug: - var: make_clean.stdout_lines + chdir: "{{ emco_dir }}/deployments/helm/emcoOpenNESS" + when: emco_dir_stat.stat.exists - - name: clean multicloud-k8s path + - name: Clean emco directory file: state: absent - path: /opt/multicloud + path: "{{ emco_dir }}" -- cgit 1.2.3-korg