From e41284f5c4c1c5f728c1274fbd7cbbf5ea963872 Mon Sep 17 00:00:00 2001 From: sathyaseelan Date: Fri, 7 Sep 2018 18:58:05 +0530 Subject: [PATCH] Update pre-check role to include delete storage pool claim and the disks (#1894) * created a tas to delete spc and the disks details in pre-check Signed-off-by: sathyaseelan * Update pre-check role to include delete storage pool claim and the disks Signed-off-by: sathyaseelan --- e2e/ansible/pre-check.yml | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/e2e/ansible/pre-check.yml b/e2e/ansible/pre-check.yml index 3e48f235de..e5ae58c461 100644 --- a/e2e/ansible/pre-check.yml +++ b/e2e/ansible/pre-check.yml @@ -27,13 +27,41 @@ delegate_to: "{{groups['kubernetes-kubemasters'].0}}" register: list_pv - - name: Delete pv's - shell: source ~/.profile; kubectl delete pv {{ item }} + - name: Delete pv's + shell: source ~/.profile; kubectl delete pv {{ item }} args: executable: /bin/bash delegate_to: "{{groups['kubernetes-kubemasters'].0}}" with_items: "{{ list_pv.stdout_lines }}" - + + - name: Get the list of available spc + shell: source ~/.profile; kubectl get spc --no-headers -o custom-columns=:metadata.name + args: + executable: /bin/bash + delegate_to: "{{groups['kubernetes-kubemasters'].0}}" + register: list_spc + + - name: Delete the spc's + shell: source ~/.profile; kubectl delete spc {{ item }} + args: + executable: /bin/bash + delegate_to: "{{groups['kubernetes-kubemasters'].0}}" + with_items: "{{ list_spc.stdout_lines }}" + + - name: Get the available disk list + shell: source ~/.profile; kubectl get disks --no-headers -o custom-columns=:metadata.name + args: + executable: /bin/bash + delegate_to: "{{ groups['kubernetes-kubemasters'].0}}" + register: list_disk + + - name: Delete the available disks + shell: source ~/.profile; kubectl delete disks {{ item }} + args: + executable: /bin/bash + delegate_to: "{{ groups['kubernetes-kubemasters'].0}}" + with_items: "{{ list_disk.stdout_lines }}" + - name: Delete namespaces which are not required shell: source ~/.profile; kubectl delete ns {{ item }} --grace-period=0 --force args: @@ -49,6 +77,6 @@ executable: /bin/bash delegate_to: "{{groups['kubernetes-kubemasters'].0}}" register: result - until: result.stdout_lines == list + until: result.stdout_lines == list delay: 30 retries: 15