Add network configuration for gateways in provisioning and inspection networks

These allow us to use different gateways for compute nodes on the inspection
and provisioning networks than on the control plane hosts also accessing these
networks.
This commit is contained in:
Mark Goddard 2017-09-01 18:22:40 +00:00
parent 5304c0a489
commit 5c6d85adfa
4 changed files with 14 additions and 2 deletions

View File

@ -102,6 +102,9 @@ def net_inspection_allocation_pool_end(context, name, inventory_hostname=None):
return net_attr(context, name, 'inspection_allocation_pool_end', inventory_hostname)
net_inspection_gateway = _make_attr_filter('inspection_gateway')
@jinja2.contextfilter
def net_neutron_allocation_pool_start(context, name, inventory_hostname=None):
return net_attr(context, name, 'neutron_allocation_pool_start', inventory_hostname)
@ -112,6 +115,9 @@ def net_neutron_allocation_pool_end(context, name, inventory_hostname=None):
return net_attr(context, name, 'neutron_allocation_pool_end', inventory_hostname)
net_neutron_gateway = _make_attr_filter('neutron_gateway')
@jinja2.contextfilter
def net_vlan(context, name, inventory_hostname=None):
return net_attr(context, name, 'vlan', inventory_hostname)
@ -416,8 +422,10 @@ class FilterModule(object):
'net_allocation_pool_end': net_allocation_pool_end,
'net_inspection_allocation_pool_start': net_inspection_allocation_pool_start,
'net_inspection_allocation_pool_end': net_inspection_allocation_pool_end,
'net_inspection_gateway': net_inspection_gateway,
'net_neutron_allocation_pool_start': net_neutron_allocation_pool_start,
'net_neutron_allocation_pool_end': net_neutron_allocation_pool_end,
'net_neutron_gateway': net_neutron_gateway,
'net_vlan': net_vlan,
'net_mtu': net_mtu,
'net_routes': net_routes,

View File

@ -171,7 +171,7 @@
# Ironic inspector's dnsmasq configuration.
kolla_inspector_dhcp_pool_start: "{{ inspection_net_name | net_inspection_allocation_pool_start }}"
kolla_inspector_dhcp_pool_end: "{{ inspection_net_name | net_inspection_allocation_pool_end }}"
kolla_inspector_default_gateway: "{{ inspection_net_name | net_gateway }}"
kolla_inspector_default_gateway: "{{ inspection_net_name | net_inspection_gateway or inspection_net_name | net_gateway }}"
# Extra free-form user-provided configuration.
kolla_extra_glance: "{{ kolla_extra_config.glance | default }}"
kolla_extra_inspector: "{{ kolla_extra_config.inspector | default }}"

View File

@ -31,6 +31,6 @@
subnets:
- name: "{{ kolla_ironic_provisioning_network }}"
cidr: "{{ provision_wl_net_name | net_cidr }}"
gateway_ip: "{{ provision_wl_net_name | net_gateway }}"
gateway_ip: "{{ provision_wl_net_name | net_neutron_gateway or provision_wl_net_name | net_gateway }}"
allocation_pool_start: "{{ provision_wl_net_name | net_neutron_allocation_pool_start }}"
allocation_pool_end: "{{ provision_wl_net_name | net_neutron_allocation_pool_end }}"

View File

@ -144,6 +144,10 @@ supported:
IP address of the end of neutron's allocation pool range.
``gateway``
IP address of the network's default gateway.
``inspection_gateway``
IP address of the gateway for the hardware introspection network.
``neutron_gateway``
IP address of the gateway for a neutron subnet based on this network.
``vlan``
VLAN ID.
``mtu``