Don't run stack delete in overcloud delete

Currently in "overcloud delete" we try to delete heat stack,
In patch[1] we added a rescue block for "Delete heat stack" task
to not fail even if we are not able to delete a stack to handle
the new ephermal heat stack case.

But user still get an intermidiate keystone exception about heat
endpoints not available[2], afterwards we print "this might be okay"
based on deployment, but this is a bit hostile for the user .

Also for ephermal heat case, we can speed up the "overcloud delete"
execution by not trying heat stack delete at all.

With tripleoclient patch[3] adding a new argument `--heat-type`
in "overcloud delete" command that will default to `pod` (ephermal
heat) and based on input we will set a var `heat_stack_delete`
that will decide whether to run heat stack delete at all.

Reverting the original "Delete heat stack" task prior to [1]
with a conditional when based on `heat_stack_delete` var.

[1] https://review.opendev.org/c/openstack/tripleo-ansible/+/807264
[2] https://bugs.launchpad.net/tripleo/+bug/1938618/comments/2
[3] https://review.opendev.org/c/openstack/python-tripleoclient/+/808539

Related-bug: #1938618
Change-Id: I9c7b11df6ac9a6a58bf3f4175d94095e0ef23fcf
This commit is contained in:
Sandeep Yadav 2021-09-11 10:30:40 +05:30
parent a237e892d6
commit 5993686014
1 changed files with 9 additions and 16 deletions

View File

@ -45,22 +45,15 @@
- name: Delete OVN MAC Address ports
tripleo_ovn_mac_addresses:
stack_name: "{{ stack_name }}"
- name: Heat block
block:
- name: Delete heat stack
openstack.cloud.stack:
name: "{{ stack_name }}"
state: absent
register: stack_delete
until: stack_delete is success
delay: 5
retries: 3
rescue:
- name: Notice
debug:
msg: >-
The Heat stack for "{{ stack_name }}" was not deleted,
depending on the deployment type this may be normal.
- name: Delete heat stack
openstack.cloud.stack:
name: "{{ stack_name }}"
state: absent
register: stack_delete
until: stack_delete is success
delay: 4
retries: 16
when: heat_stack_delete|default(false)
- name: Remove the config download stack
file:
path: "{{ config_download_path }}/{{ stack_name }}"