From 5c6d85adfa1b0905aff8886b8a1f4bc11b70c6ca Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Fri, 1 Sep 2017 18:22:40 +0000 Subject: [PATCH] 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. --- ansible/filter_plugins/networks.py | 8 ++++++++ ansible/kolla-openstack.yml | 2 +- ansible/provision-net.yml | 2 +- doc/source/configuration.rst | 4 ++++ 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ansible/filter_plugins/networks.py b/ansible/filter_plugins/networks.py index 0e2f3e471..27f8787c9 100644 --- a/ansible/filter_plugins/networks.py +++ b/ansible/filter_plugins/networks.py @@ -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, diff --git a/ansible/kolla-openstack.yml b/ansible/kolla-openstack.yml index 485e4ce72..4118ad138 100644 --- a/ansible/kolla-openstack.yml +++ b/ansible/kolla-openstack.yml @@ -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 }}" diff --git a/ansible/provision-net.yml b/ansible/provision-net.yml index fca740d8b..7f04aeb7c 100644 --- a/ansible/provision-net.yml +++ b/ansible/provision-net.yml @@ -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 }}" diff --git a/doc/source/configuration.rst b/doc/source/configuration.rst index d1c2bd06e..d079c9950 100644 --- a/doc/source/configuration.rst +++ b/doc/source/configuration.rst @@ -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``