diff --git a/upi/openstack/common.yaml b/upi/openstack/common.yaml index 47bd82e01bd..531c5a89210 100644 --- a/upi/openstack/common.yaml +++ b/upi/openstack/common.yaml @@ -47,3 +47,4 @@ # Port names os_port_api: "{{ os_net_id }}-api-port" os_port_ingress: "{{ os_net_id }}-ingress-port" + when: os_net_id is defined diff --git a/upi/openstack/down-network.yaml b/upi/openstack/down-network.yaml index 7f44c4e8573..c357f8483e8 100644 --- a/upi/openstack/down-network.yaml +++ b/upi/openstack/down-network.yaml @@ -40,6 +40,16 @@ cmd: "openstack port delete {{ ports.stdout_lines | join(' ') }}" when: ports.stdout != "" + - name: 'List FIPs' + ansible.builtin.command: + cmd: "openstack floating ip list --router {{ os_router}} -f value -c ID" + register: fips + + - name: 'Remove the cluster FIPs' + ansible.builtin.command: + cmd: "openstack floating ip delete {{ fips.stdout_lines | join(' ') }}" + when: fips.stdout != "" + - name: 'Remove the cluster router' openstack.cloud.router: name: "{{ os_router }}"