Delete OVN MAC addr ports prior to deleting stack

With I6ce29d2908e76044c55eb96d0d3779fe67ba9169 the
OVN MAC address ports created as part of deploy-steps
playbook run won't be cleaned up on 'overcloud delete'

This change fixes that by running the ansible module
tripleo_ovn_mac_addresses without specifying a list
of services.

Implements: blueprint network-data-v2-port
Depends-On: https://review.opendev.org/782892
Change-Id: Id08cb1f907ba9ea9fb1bf1865d8a6491b463c44d
This commit is contained in:
Harald Jensås 2021-04-22 06:58:39 +02:00 committed by Rabi Mishra
parent b46a9f52e7
commit c87997e36a
3 changed files with 8 additions and 3 deletions

View File

@ -68,3 +68,4 @@ mock_modules:
- tripleo_overcloud_network_vip_extract
- tripleo_overcloud_network_vip_provision
- tripleo_overcloud_network_vip_populate_environment
- tripleo_ovn_mac_addresses

View File

@ -228,7 +228,7 @@ def run_module():
stack = module.params.get('stack_name', 'overcloud')
role_name = module.params['role_name']
bridge_mappings = module.params['ovn_bridge_mappings']
servers = module.params['server_resource_names']
servers = module.params.get('server_resource_names') or []
playbook_dir = module.params['playbook_dir']
concurrency = module.params.get('concurrency', 0)
static_mappings = module.params.get(
@ -241,8 +241,9 @@ def run_module():
_, conn = openstack_cloud_from_module(module)
net_id = create_ovn_mac_address_network(result, conn)
tags = ['tripleo_stack_name={}'.format(stack),
'tripleo_role={}'.format(role_name)]
tags = ['tripleo_stack_name={}'.format(stack)]
if role_name:
tags.append('tripleo_role={}'.format(role_name))
# no limit on concurrency, create a worker for every server
if concurrency < 1:

View File

@ -34,6 +34,9 @@
tripleo_service_vip:
stack_name: "{{ stack_name }}"
state: absent
- name: Delete OVN MAC Address ports
tripleo_ovn_mac_addresses:
stack: "{{ stack_name }}"
- name: Delete heat stack
openstack.cloud.stack:
name: "{{ stack_name }}"