Skip to content

Commit 27d6391

Browse files
authored
Initial eBGP Fabric Support (#460)
* move initial ebgp fabric work to new branch * remove tmp file * Update ebgp_vxlan_fabric_base.j2 * swap fabric global name from standup meeting discussion * update defaults key * adjustments from testing with module updates * update after testing module * add backwards compatability for 3.1.1 * fix security support * update security * backout tasks * updates to setup ebgp development * fix year
1 parent 8097fed commit 27d6391

File tree

56 files changed

+535
-5
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+535
-5
lines changed

plugins/action/common/nac_dc_validate.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2024 Cisco Systems, Inc. and its affiliates
1+
# Copyright (c) 2025 Cisco Systems, Inc. and its affiliates
22
#
33
# Permission is hereby granted, free of charge, to any person obtaining a copy of
44
# this software and associated documentation files (the "Software"), to deal in
@@ -92,7 +92,7 @@ def run(self, tmp=None, task_vars=None):
9292
if 'fabric' in check['keys_found'] and 'fabric' in check['keys_data']:
9393
if 'type' in results['data']['vxlan']['fabric']:
9494
if results['data']['vxlan']['fabric']['type'] in ('VXLAN_EVPN'):
95-
rules_list.append(f'{rules}vxlan/')
95+
rules_list.append(f'{rules}ibgp_vxlan/')
9696
elif results['data']['vxlan']['fabric']['type'] in ('MSD', 'MCF'):
9797
rules_list.append(f'{rules}multisite/')
9898
elif results['data']['vxlan']['fabric']['type'] in ('ISN'):
@@ -118,7 +118,7 @@ def run(self, tmp=None, task_vars=None):
118118
display.deprecated(msg=deprecated_msg, version='1.0.0', collection_name='cisco.nac_dc_vxlan')
119119

120120
if results['data']['vxlan']['global']['fabric_type'] in ('VXLAN_EVPN'):
121-
rules_list.append(f'{rules}vxlan/')
121+
rules_list.append(f'{rules}ibgp_vxlan/')
122122
elif results['data']['vxlan']['global']['fabric_type'] in ('MSD', 'MCF'):
123123
rules_list.append(f'{rules}multisite/')
124124
elif results['data']['vxlan']['global']['fabric_type'] in ('ISN', 'External'):

roles/dtc/common/tasks/main.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2024 Cisco Systems, Inc. and its affiliates
1+
# Copyright (c) 2025 Cisco Systems, Inc. and its affiliates
22
#
33
# Permission is hereby granted, free of charge, to any person obtaining a copy of
44
# this software and associated documentation files (the "Software"), to deal in
@@ -91,6 +91,11 @@
9191
tags: "{{ nac_tags.common_role }}" # Tags defined in roles/common_global/vars/main.yml
9292
when: MD_Extended.vxlan.fabric.type == 'VXLAN_EVPN'
9393

94+
- name: Import Role Tasks for eBGP VXLAN Fabric
95+
ansible.builtin.import_tasks: sub_main_ebgp_vxlan.yml
96+
tags: "{{ nac_tags.common_role }}" # Tags defined in roles/common_global/vars/main.yml
97+
when: MD_Extended.vxlan.fabric.type == 'eBGP_VXLAN'
98+
9499
- name: Import Role Tasks for ISN Fabric
95100
ansible.builtin.import_tasks: sub_main_isn.yml
96101
tags: "{{ nac_tags.common_role }}" # Tags defined in roles/common_global/vars/main.yml
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Copyright (c) 2025 Cisco Systems, Inc. and its affiliates
2+
#
3+
# Permission is hereby granted, free of charge, to any person obtaining a copy of
4+
# this software and associated documentation files (the "Software"), to deal in
5+
# the Software without restriction, including without limitation the rights to
6+
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
7+
# the Software, and to permit persons to whom the Software is furnished to do so,
8+
# subject to the following conditions:
9+
#
10+
# The above copyright notice and this permission notice shall be included in all
11+
# copies or substantial portions of the Software.
12+
#
13+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
15+
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
16+
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
17+
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
18+
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19+
#
20+
# SPDX-License-Identifier: MIT
21+
22+
---
23+
24+
- ansible.builtin.fail: msg="Service Model Not Defined. Role cisco.nac_dc_vxlan.validate Must Be Called First"
25+
when: MD is undefined
26+
delegate_to: localhost
27+
28+
# --------------------------------------------------------------------
29+
# Remove all files from the previous run if run_map requires it
30+
# --------------------------------------------------------------------
31+
- name: Set path_name Var
32+
ansible.builtin.set_fact:
33+
path_name: "{{ role_path }}/files/ebgp_vxlan/{{ MD_Extended.vxlan.fabric.name }}/"
34+
delegate_to: localhost
35+
36+
- name: Cleanup Files from Previous Run if run_map requires it
37+
ansible.builtin.import_tasks: cleanup_files.yml
38+
when:
39+
- not run_map_read_result.diff_run or ((force_run_all is defined) and (force_run_all is true|bool))
40+
41+
# --------------------------------------------------------------------
42+
# Build Create Fabric parameter List From Template
43+
# --------------------------------------------------------------------
44+
45+
- name: Build Fabric Create Parameters
46+
ansible.builtin.import_tasks: common/ndfc_fabric.yml
47+
48+
# --------------------------------------------------------------------
49+
# Save Local Variables To NameSpace Dict For Use Elsewhere
50+
# --------------------------------------------------------------------
51+
- name: Save Local Variables With Namespace Context
52+
ansible.builtin.set_fact:
53+
vars_common_ebgp_vxlan:
54+
changes_detected_fabric: "{{ changes_detected_fabric }}"
55+
fabric_config: "{{ fabric_config }}"
56+
57+
- name: Run Diff Flags
58+
ansible.builtin.debug:
59+
msg:
60+
- "----------------------------------------------------------------"
61+
- "+ Fabric Changes Detected - [ {{ vars_common_ebgp_vxlan.changes_detected_fabric }} ]"
62+
- "+ ----- Run Map -----"
63+
- "+ Run Map Diff Run - [ {{ run_map_read_result.diff_run }} ]"
64+
- "+ Force Run Flag - [ {{ force_run_all }} ]"
65+
- "----------------------------------------------------------------"

roles/dtc/common/templates/ndfc_fabric.j2

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
{# Include NDFC DC VXLAN EVPN Base Template #}
1010
{% include '/ndfc_fabric/dc_vxlan_fabric/dc_vxlan_fabric_base.j2' %}
1111

12+
{% elif vxlan.fabric.type == 'eBGP_VXLAN'%}
13+
14+
{# Include NDFC eBGP VXLAN EVPN Base Template #}
15+
{% include '/ndfc_fabric/ebgp_vxlan_fabric/ebgp_vxlan_fabric_base.j2' %}
16+
1217
{% elif vxlan.fabric.type == 'MSD'%}
1318

1419
{# Include NDFC MSD Base Template #}

roles/dtc/common/templates/ndfc_fabric/ebgp_vxlan_fabric/advanced/.gitkeep

Whitespace-only changes.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{# Auto-generated NDFC eBGP VXLAN EVPN Advanced config data structure for fabric {{ vxlan.fabric.name }} #}
2+
OVERLAY_MODE: cli
3+
GRFIELD_DEBUG_FLAG: Enable
4+
ENABLE_PVLAN: false
5+
AAA_REMOTE_IP_ENABLED: False
6+
FABRIC_MTU: {{ vxlan.underlay.general.intra_fabric_interface_mtu | default(defaults.vxlan.underlay.general.intra_fabric_interface_mtu) }}
7+
L2_HOST_INTF_MTU: {{ vxlan.underlay.general.layer2_host_interface_mtu | default(defaults.vxlan.underlay.general.layer2_host_interface_mtu) }}
8+
{% if vxlan.global.bootstrap is defined and vxlan.global.bootstrap.enable_cdp_mgmt is defined %}
9+
CDP_ENABLE: {{ vxlan.global.bootstrap.enable_cdp_mgmt }}
10+
{% endif %}
11+
ENABLE_NXAPI: {{ vxlan.global.enable_nxapi_https | default(defaults.vxlan.global.enable_nxapi_https) }}
12+
{% if vxlan.global.enable_nxapi_https | default(defaults.vxlan.global.enable_nxapi_https) | ansible.builtin.bool %}
13+
NXAPI_HTTPS_PORT: {{ vxlan.global.nxapi_https_port | default(defaults.vxlan.global.nxapi_https_port) }}
14+
ENABLE_NXAPI_HTTP: {{ vxlan.global.enable_nxapi_http | default(defaults.vxlan.global.enable_nxapi_http) }}
15+
{% if vxlan.global.enable_nxapi_http | default(defaults.vxlan.global.enable_nxapi_http) | ansible.builtin.bool %}
16+
NXAPI_HTTP_PORT: {{ vxlan.global.nxapi_http_port | default(defaults.vxlan.global.nxapi_http_port) }}
17+
{% endif %}
18+
{% endif %}
19+
SNMP_SERVER_HOST_TRAP: {{ vxlan.global.snmp_server_host_trap | default(defaults.vxlan.global.snmp_server_host_trap) }}
20+
{% if ( (ndfc_version | cisco.nac_dc_vxlan.version_compare('12.2.2', '>=')) and
21+
(not (vxlan.underlay.general.enable_ipv6_underlay | default(defaults.vxlan.underlay.general.enable_ipv6_underlay) | ansible.builtin.bool)) ) %}
22+
FEATURE_PTP: {{ vxlan.global.ptp.enable | default(defaults.vxlan.global.ptp.enable) }}
23+
{% if vxlan.global.ptp.enable is defined and vxlan.global.ptp.enable | ansible.builtin.bool %}
24+
PTP_DOMAIN_ID: {{ vxlan.global.ptp.domain_id | default(defaults.vxlan.global.ptp.domain_id) }}
25+
PTP_LB_ID: {{ vxlan.global.ptp.lb_id | default(defaults.vxlan.global.ptp.lb_id) }}
26+
{% if vxlan.global.ptp.vlan_id is defined %}
27+
PTP_VLAN_ID: {{ vxlan.global.ptp.vlan_id }}
28+
{% endif %}
29+
{% endif %}
30+
{% endif %}

roles/dtc/common/templates/ndfc_fabric/ebgp_vxlan_fabric/bootstrap/.gitkeep

Whitespace-only changes.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{# Auto-generated NDFC eBGP VXLAN EVPN Bootstrap config data structure for fabric {{ vxlan.fabric.name }} #}
2+
{% if vxlan.global.bootstrap is defined %}
3+
BOOTSTRAP_ENABLE: {{ vxlan.global.bootstrap.enable_bootstrap | default(defaults.vxlan.global.bootstrap.enable_bootstrap) | bool }}
4+
{% if vxlan.global.bootstrap.enable_bootstrap | default(defaults.vxlan.global.bootstrap.enable_bootstrap) | bool %}
5+
DHCP_ENABLE: {{ vxlan.global.bootstrap.enable_local_dhcp_server | default(defaults.vxlan.global.bootstrap.enable_local_dhcp_server) | bool }}
6+
{% if vxlan.global.bootstrap.enable_local_dhcp_server | default(defaults.vxlan.global.bootstrap.enable_local_dhcp_server) | bool %}
7+
DHCP_IPV6_ENABLE: {{ vxlan.global.bootstrap.dhcp_version }}
8+
{% if vxlan.global.bootstrap.dhcp_version is defined and vxlan.global.bootstrap.dhcp_version == "DHCPv4" %}
9+
DHCP_START: {{ vxlan.global.bootstrap.dhcp_v4.scope_start_address }}
10+
DHCP_END: {{ vxlan.global.bootstrap.dhcp_v4.scope_end_address }}
11+
MGMT_GW: {{ vxlan.global.bootstrap.dhcp_v4.switch_mgmt_default_gw }}
12+
MGMT_PREFIX: {{ vxlan.global.bootstrap.dhcp_v4.mgmt_prefix }}
13+
{% if vxlan.global.bootstrap.dhcp_v4.multi_subnet_scope is defined %}
14+
BOOTSTRAP_MULTISUBNET: "{{ vxlan.global.bootstrap.dhcp_v4.multi_subnet_scope }}"
15+
{% endif %}
16+
{% endif %}
17+
{% endif %}
18+
{% endif %}
19+
{% endif %}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{# Auto-generated NDFC eBGP VXLAN EVPN Base config data structure for fabric {{ vxlan.fabric.name }} #}
2+
{% from 'macros/convert_ranges.j2' import convert_ranges as convert_ranges %}
3+
- FABRIC_NAME: {{ vxlan.fabric.name }}
4+
FABRIC_TYPE: BGP
5+
DEPLOY: False
6+
7+
{# Include NDFC eBGP VXLAN EVPN General Template #}
8+
{% include '/ndfc_fabric/ebgp_vxlan_fabric/general/ebgp_vxlan_fabric_general.j2' %}
9+
10+
{# Include NDFC eBGP VXLAN EVPN Template #}
11+
{% include '/ndfc_fabric/ebgp_vxlan_fabric/evpn/ebgp_vxlan_fabric_evpn.j2' %}
12+
13+
{# Include NDFC eBGP VXLAN EVPN vPC Template #}
14+
{% include '/ndfc_fabric/ebgp_vxlan_fabric/vpc/ebgp_vxlan_fabric_vpc.j2' %}
15+
16+
{# Include NDFC eBGP VXLAN EVPN Protocols Template #}
17+
{% include '/ndfc_fabric/ebgp_vxlan_fabric/protocols/ebgp_vxlan_fabric_protocols.j2' %}
18+
19+
{% if ndfc_version | cisco.nac_dc_vxlan.version_compare('12.2.2', '>=') %}
20+
{# Include NDFC eBGP VXLAN EVPN Security Template #}
21+
{% include '/ndfc_fabric/ebgp_vxlan_fabric/security/ebgp_vxlan_fabric_security.j2' %}
22+
{% endif %}
23+
24+
{# Include NDFC eBGP VXLAN EVPN Advanced Template #}
25+
{% include '/ndfc_fabric/ebgp_vxlan_fabric/advanced/ebgp_vxlan_fabric_advanced.j2' %}
26+
27+
{# Include NDFC eBGP VXLAN EVPN Manageability Template #}
28+
{% include '/ndfc_fabric/ebgp_vxlan_fabric/manageability/ebgp_vxlan_fabric_manageability.j2' %}
29+
30+
{# Include NDFC eBGP VXLAN EVPN Bootstrap Template #}
31+
{% include '/ndfc_fabric/ebgp_vxlan_fabric/bootstrap/ebgp_vxlan_fabric_bootstrap.j2' %}
32+
33+
{# Include NDFC eBGP VXLAN EVPN Flow Monitor Template #}
34+
{% include '/ndfc_fabric/ebgp_vxlan_fabric/flow_monitor/ebgp_vxlan_fabric_flow_monitor.j2' %}

0 commit comments

Comments
 (0)