Support multiple external networks

This commit is contained in:
Mark Goddard 2017-11-30 18:26:52 +00:00
parent 3608993e36
commit 5b0a90baa4
8 changed files with 38 additions and 26 deletions

View File

@ -8,15 +8,16 @@
os_networks_openstack_auth_type: "{{ openstack_auth_type }}"
os_networks_openstack_auth: "{{ openstack_auth }}"
# Network configuration.
os_networks_name: "{{ external_net_name }}"
os_networks_type: "{% if external_net_name | net_vlan %}vlan{% else %}flat{% endif %}"
os_networks_name: "{{ item }}"
os_networks_type: "{% if item | net_vlan %}vlan{% else %}flat{% endif %}"
os_networks_physical_network: "physnet1"
os_networks_segmentation_id: "{{ external_net_name | net_vlan }}"
os_networks_segmentation_id: "{{ item | net_vlan }}"
os_networks_shared: True
os_networks_external: True
# Subnet configuration.
os_networks_subnet_name: "{{ external_net_name }}"
os_networks_cidr: "{{ external_net_name | net_cidr }}"
os_networks_gateway_ip: "{{ external_net_name | net_gateway }}"
os_networks_allocation_pool_start: "{{ external_net_name | net_neutron_allocation_pool_start }}"
os_networks_allocation_pool_end: "{{ external_net_name | net_neutron_allocation_pool_end }}"
os_networks_subnet_name: "{{ item }}"
os_networks_cidr: "{{ item | net_cidr }}"
os_networks_gateway_ip: "{{ item | net_gateway }}"
os_networks_allocation_pool_start: "{{ item | net_neutron_allocation_pool_start }}"
os_networks_allocation_pool_end: "{{ item | net_neutron_allocation_pool_end }}"
with_items: "{{ external_net_names }}"

View File

@ -30,8 +30,8 @@ controller_extra_network_interfaces: []
# List of network interfaces to which network nodes are attached.
controller_network_host_network_interfaces: >
{{ [public_net_name,
external_net_name] | unique | list }}
{{ ([public_net_name] +
external_net_names) | unique | list }}
###############################################################################
# Controller node BIOS configuration.

View File

@ -21,12 +21,21 @@ provision_wl_net_name: 'provision_wl_net'
# Name of the network used to expose the internal OpenStack API endpoints.
internal_net_name: 'internal_net'
# Name of the network used to expose the external OpenStack API endpoints and
# to provide external network access via Neutron.
external_net_name: 'external_net'
# List of names of networks used to provide external network access via
# Neutron.
# Deprecated name: external_net_name
# If external_net_name is defined, external_net_names will default to a list
# containing one item, external_net_name.
external_net_names: >
{{ [external_net_name]
if external_net_name is defined else
['external_net'] }}
# Name of the network used to expose the public OpenStack API endpoints.
public_net_name: "{{ external_net_name }}"
public_net_name: >
{{ external_net_names[0]
if external_net_names | length > 0 else
None }}
# Name of the network used to carry storage data traffic.
storage_net_name: 'storage_net'

View File

@ -103,10 +103,7 @@
{{ kolla_neutron_bridge_interfaces |
union([item | net_interface(network_host) | replace('.' ~ item | net_vlan(network_host) | default('!nomatch!'), '')]) |
list }}
with_items:
# FIXME: Network host does not have an IP on this network.
- "{{ provision_wl_net_name }}"
- "{{ external_net_name }}"
with_items: "{{ [provision_wl_net_name] + external_net_names }}"
when: item in hostvars[network_host].network_interfaces
- name: Set facts containing the Neutron bridge and interface names

View File

@ -85,9 +85,7 @@
set_fact:
veth_bridges: >
{{ veth_bridges | union([bridge_obj]) | list }}
with_items:
- "{{ provision_wl_net_name }}"
- "{{ external_net_name }}"
with_items: "{{ [provision_wl_net_name] + external_net_names }}"
when: item in network_interfaces
vars:
interface: "{{ item | net_interface | replace('.' ~ item | net_vlan | default('!nomatch!'), '') }}"

View File

@ -391,8 +391,10 @@ Internal network (``internal_net_name``)
Name of the network used to expose the internal OpenStack API endpoints.
Public network (``public_net_name``)
Name of the network used to expose the public OpenStack API endpoints.
External network (``external_net_name``)
Name of the network used to provide external network access via Neutron.
External networks (``external_net_names``, deprecated: ``external_net_name``)
List of names of networks used to provide external network access via
Neutron. If ``external_net_name`` is defined, ``external_net_names``
defaults to a list containing only that network.
Storage network (``storage_net_name``)
Name of the network used to carry storage data traffic.
Storage management network (``storage_mgmt_net_name``)

View File

@ -26,6 +26,8 @@ Features
single host.
* Adds support for deployment of virtualised compute hosts. These hosts should
be added to the ``[compute]`` group.
* Adds support for multiple external networks. ``external_net_names`` should
be a list of names of networks.
Upgrade Notes
-------------

View File

@ -23,9 +23,12 @@
# Name of the network used to expose the internal OpenStack API endpoints.
#internal_net_name:
# Name of the network used to expose the external OpenStack API endpoints and
# to provide external network access via Neutron.
#external_net_name:
# List of names of networks used to provide external network access via
# Neutron.
# Deprecated name: external_net_name
# If external_net_name is defined, external_net_names will default to a list
# containing one item, external_net_name.
#external_net_names:
# Name of the network used to expose the public OpenStack API endpoints.
#public_net_name: