tobiko/roles/tobiko-cleanup/tasks/main.yaml
Eduardo Olivares afb3c5a99d Make stack cleanup task more robust
Deletion of heat stacks created by tobiko is not stable enough: the
command hangs forever and some stacks are not successfully deleted
In order to make this task more stable, a timeout is added to the
command and retries are added to the task

Change-Id: I7e1b851d7aa98007917675856cc20bc8fa4085a1
2022-03-21 14:05:21 +01:00

29 lines
835 B
YAML

---
- name: "cleanup Loadbalancers created by Tobiko tests"
shell: |
source {{ stackrc_file }}
openstack loadbalancer list -f value -c 'name' | \
grep "^tobiko\." | \
xargs -r openstack loadbalancer delete --cascade --wait
ignore_errors: yes
- name: "cleanup Heat stacks created by Tobiko tests"
shell: |
source {{ stackrc_file }}
openstack stack list -f value -c 'Stack Name' | \
grep "^tobiko\." | \
xargs -r timeout 180 openstack stack delete -y --wait
register: result
retries: 5
delay: 5
until: result.rc == 0
ignore_errors: yes
- name: "cleanup Glance images created by Tobiko tests"
shell: |
source {{ stackrc_file }}
openstack image list -f value -c 'Name' | \
grep "^tobiko\." | \
xargs -r openstack image delete
ignore_errors: yes