Change network modules to work with new SDK

Change-Id: I7625d696f6462a7a955008a5c7276f1548acbc2e
This commit is contained in:
Sagi Shnaidman
2022-01-19 12:24:08 +02:00
committed by Jakob Meng
parent a9fa496ebe
commit 9272146cf7
6 changed files with 275 additions and 136 deletions

View File

@@ -8,7 +8,7 @@
- name: Assert that public network exists
assert:
that: public_network.openstack_networks|length == 1
that: public_network.networks|length == 1
- name: Create external network
openstack.cloud.network:
@@ -120,7 +120,7 @@
- name: Check if public network has any floating ips
set_fact:
public_network_had_fips: "{{ fips.floating_ips|
selectattr('floating_network_id', '==', public_network.openstack_networks.0.id)|
selectattr('floating_network_id', '==', public_network.networks.0.id)|
list|length > 0 }}"
# TODO: Replace with appropriate Ansible module once available
@@ -371,7 +371,7 @@
when: not public_network_had_fips
command: >
openstack --os-cloud={{ cloud }} floating ip delete
{{ fips.floating_ips|selectattr('floating_network_id', '==', public_network.openstack_networks.0.id)|
{{ fips.floating_ips|selectattr('floating_network_id', '==', public_network.networks.0.id)|
map(attribute="floating_ip_address")|list|join(' ') }}
# TODO: Replace with appropriate Ansible module once available