2019-04-17 05:49:07 +08:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: Check if temp directory for {{ test_name }} exists
|
|
|
|
stat:
|
|
|
|
path: "/tmp/{{ test_name }}"
|
2021-02-10 21:36:59 +08:00
|
|
|
get_attributes: no
|
|
|
|
get_checksum: no
|
|
|
|
get_mime: no
|
2019-04-17 05:49:07 +08:00
|
|
|
register: temp_dir_details
|
|
|
|
|
|
|
|
- name: "Cleanup temp directory for {{ test_name }}"
|
|
|
|
file:
|
|
|
|
path: "/tmp/{{ test_name }}"
|
|
|
|
state: absent
|
|
|
|
|
|
|
|
- name: "Cleanup namespace for {{ test_name }}"
|
2022-03-25 18:24:17 +08:00
|
|
|
command: "kubectl delete namespace {{ test_name }}"
|
|
|
|
changed_when: false
|
2019-04-17 05:49:07 +08:00
|
|
|
|
2020-07-28 16:39:08 +08:00
|
|
|
- name: Wait for namespace {{ test_name }} to be fully deleted
|
|
|
|
command: kubectl get ns {{ test_name }}
|
2019-04-17 05:49:07 +08:00
|
|
|
register: delete_namespace
|
|
|
|
failed_when:
|
|
|
|
- delete_namespace.rc == 0
|
|
|
|
changed_when:
|
|
|
|
- delete_namespace.rc == 0
|
|
|
|
retries: 12
|
|
|
|
delay: "10"
|
|
|
|
until:
|
|
|
|
- delete_namespace.rc != 0
|