Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BGP] ipv4routes can be defined for netconfig #2516

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions plugins/module_utils/net_map/networking_env_definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ class MappedNetconfigNetworkConfig:

ipv4_ranges: typing.List[MappedIpv4NetworkRange]
ipv6_ranges: typing.List[MappedIpv6NetworkRange]
ipv4_routes: typing.List[MappedIpv4NetworkRoute]
ipv6_routes: typing.List[MappedIpv6NetworkRoute]


@dataclasses.dataclass(frozen=True)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ data:
- end: {{ range.end }}
start: {{ range.start }}
{% endfor %}
{% if network.tools.netconfig.ipv4_routes | default([]) | length > 0 %}
routes:
{% for route in network.tools.netconfig.ipv4_routes %}
- destination: {{ route.destination }}
nexthop: {{ route.gateway }}
{% endfor %}
{% endif %}
cidr: {{ network.network_v4 }}
{% if network.gw_v4 is defined %}
gateway: {{ network.gw_v4 }}
Expand Down