Merge "Add support for custom options in static routes"

This commit is contained in:
Zuul 2020-07-28 16:50:28 +00:00 committed by Gerrit Code Review
commit 96dfbe4483
3 changed files with 23 additions and 4 deletions

View File

@ -178,6 +178,7 @@ def _route_obj(route):
optional = { optional = {
'gateway', 'gateway',
'table', 'table',
'options',
} }
for option in optional: for option in optional:
if option in route: if option in route:

View File

@ -47,10 +47,11 @@ supported:
Fully Qualified Domain Name (FQDN) used by API services on this network. Fully Qualified Domain Name (FQDN) used by API services on this network.
``routes`` ``routes``
List of static IP routes. Each item should be a dict containing the List of static IP routes. Each item should be a dict containing the
item ``cidr``, and optionally ``gateway`` and ``table``. ``cidr`` is the CIDR item ``cidr``, and optionally ``gateway``, ``table`` and ``options``.
representation of the route's destination. ``gateway`` is the IP address of ``cidr`` is the CIDR representation of the route's destination. ``gateway``
the next hop. ``table`` is the name or ID of a routing table to which the is the IP address of the next hop. ``table`` is the name or ID of a routing
route will be added. table to which the route will be added. ``options`` is a list of option
strings to add to the route.
``rules`` ``rules``
List of IP routing rules. Each item should be an ``iproute2`` IP routing List of IP routing rules. Each item should be an ``iproute2`` IP routing
rule. rule.
@ -139,6 +140,18 @@ To configure a network called ``example`` with a single IP route to the
These routes will be configured on all hosts to which the network is mapped. These routes will be configured on all hosts to which the network is mapped.
If necessary, custom options may be added to the route:
.. code-block:: yaml
:caption: ``networks.yml``
example_routes:
- cidr: 10.1.0.0/24
gateway: 10.0.0.1
options:
- onlink
- metric 400
Configuring a VLAN Configuring a VLAN
------------------ ------------------

View File

@ -0,0 +1,5 @@
---
features:
- |
Adds support for custom options in static routes. See `story 2007835
<https://storyboard.openstack.org/#!/story/2007835>`__ for details.