From 7bc7d1686a02b1996d73cc00443a660b9bd3d7bc Mon Sep 17 00:00:00 2001 From: Alex Katz Date: Mon, 22 Nov 2021 16:05:21 +0200 Subject: [PATCH] Make tobiko-cleanup role not to stuck at stack deletion Change-Id: I721db29d0e03fec38436ff4820f5f461d3689443 --- roles/tobiko-cleanup/tasks/main.yaml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/roles/tobiko-cleanup/tasks/main.yaml b/roles/tobiko-cleanup/tasks/main.yaml index 70fa72402..cbcfc3310 100644 --- a/roles/tobiko-cleanup/tasks/main.yaml +++ b/roles/tobiko-cleanup/tasks/main.yaml @@ -1,8 +1,17 @@ --- -- name: "cleanup stacks created by tobiko tests" +- name: "cleanup Heat stacks created by Tobiko tests" shell: | source {{ stackrc_file }} - openstack stack list -f value -c 'Stack Name' | grep "^tobiko\." | xargs openstack stack delete --wait - openstack image list -f value -c Name | grep "^tobiko\." | xargs openstack image delete + openstack stack list -f value -c 'Stack Name' | \ + grep "^tobiko\." | \ + xargs -r openstack stack delete -y --wait + 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