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