From c7cf0d1688bbd7f039a796ddca2298138491c727 Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Mon, 7 Aug 2017 11:41:52 +0000 Subject: [PATCH] Add support for physical_network attribute of networks A network may be assigned a physical network by defining a variable of the form _physical_network. Currently this is not used by kayobe but may be referenced in configuration e.g. when setting neutron_vlan_ranges. --- ansible/filter_plugins/networks.py | 2 ++ doc/source/configuration.rst | 3 +++ 2 files changed, 5 insertions(+) diff --git a/ansible/filter_plugins/networks.py b/ansible/filter_plugins/networks.py index 1b39d41f8..313042498 100644 --- a/ansible/filter_plugins/networks.py +++ b/ansible/filter_plugins/networks.py @@ -119,6 +119,7 @@ def net_vlan(context, name, inventory_hostname=None): net_mtu = _make_attr_filter('mtu') net_routes = _make_attr_filter('routes') +net_physical_network = _make_attr_filter('physical_network') @jinja2.contextfilter @@ -414,6 +415,7 @@ class FilterModule(object): 'net_vlan': net_vlan, 'net_mtu': net_mtu, 'net_routes': net_routes, + 'net_physical_network': net_physical_network, 'net_interface_obj': net_interface_obj, 'net_bridge_obj': net_bridge_obj, 'net_bond_obj': net_bond_obj, diff --git a/doc/source/configuration.rst b/doc/source/configuration.rst index a768c690c..246bfddcb 100644 --- a/doc/source/configuration.rst +++ b/doc/source/configuration.rst @@ -147,6 +147,9 @@ supported: List of static IP routes. Each item should be a dict containing the items ``cidr`` and ``gateway``. ``cidr`` is the CIDR representation of the route's destination. ``gateway`` is the IP address of the next hop. +``physical_network`` + Name of the physical network on which this network exists. This aligns with + the physical network concept in neutron. ``libvirt_network_name`` A name to give to a Libvirt network representing this network on the seed hypervisor.