Skip to content

Commit 1fcdd76

Browse files
[os_net_setup] Add --availability-zone-hint to network creation
This PR adds the option to configure external networks for certain AZs. In order to do this, the list `availability_zone_hints` should be configured as port of `cifmw_os_net_setup_config`.
1 parent 20bb03c commit 1fcdd76

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

roles/os_net_setup/defaults/main.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ cifmw_os_net_setup_config:
88
is_default: true
99
provider_network_type: flat
1010
provider_physical_network: datacentre
11+
# availability_zone_hints is a list of AZs that should have been configured in neutron controlplane). Example:
12+
# availability_zone_hints:
13+
# - zone-1
14+
# - zone-2
15+
# availability_zone_hints defaults to empty list
16+
availability_zone_hints: []
1117
subnets:
1218
- name: public_subnet
1319
cidr: 192.168.122.0/24

roles/os_net_setup/templates/network_command.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,8 @@ oc exec -n openstack openstackclient -- openstack network create \
3535
{% if net_args.is_vlan_transparent is defined and net_args.is_vlan_transparent %}
3636
--transparent-vlan \
3737
{% endif %}
38+
{% for az in (net_args.availability_zone_hints | default([])) %}
39+
--availability-zone-hint {{ az }} \
40+
{% endfor %}
3841
{{ net_args.name }}
3942
{% endfor %}

0 commit comments

Comments
 (0)