Skip to content

Commit

Permalink
Update pre-check role to include delete storage pool claim and the di…
Browse files Browse the repository at this point in the history
…sks (openebs#1894)

* created a tas to delete spc and the disks details in pre-check

Signed-off-by: sathyaseelan <sathyaseelan.n@cloudbyte.com>

* Update pre-check role to include delete storage pool claim and the disks

Signed-off-by: sathyaseelan <sathyaseelan.n@cloudbyte.com>
  • Loading branch information
nsathyaseelan authored and yudaykiran committed Sep 7, 2018
1 parent 783b4c3 commit e41284f
Showing 1 changed file with 32 additions and 4 deletions.
36 changes: 32 additions & 4 deletions e2e/ansible/pre-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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

0 comments on commit e41284f

Please sign in to comment.