This repository has been archived by the owner on Jul 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 66
/
Copy pathmain.conf.j2
81 lines (76 loc) · 2.06 KB
/
main.conf.j2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/* This block of configuration has been generated by the role overlay-evpn-access for Ansible */
{% if access is defined %}
{% if access.nbr_ae is defined %}
chassis {
aggregated-devices {
ethernet {
device-count {{ access.nbr_ae }};
}
}
}
{% endif %}
interfaces {
{% for interface in access.interfaces %}
{{ interface.name }} {
{% if interface.description is defined %}
description "to {{ interface.description }}";
{% endif %}
{% if interface.esi is defined %}
esi {
{{ interface.esi }};
all-active;
}
{% endif %}
{% if interface.mode == 'aggregate' %}
ether-options {
802.3ad {{ interface.parent }};
}
{% elif interface.mode == 'trunk' %}
unit 0 {
family ethernet-switching {
interface-mode {{ interface.mode }};
vlan {
members [{% for vlan in interface.vlans %} {{ vlan }}{% endfor %}];
}
}
}
{% elif interface.mode == 'access' %}
unit 0 {
family ethernet-switching {
interface-mode {{ interface.mode }};
vlan {
members [{% for vlan in interface.vlans %} {{ vlan }}{% endfor %}];
}
}
}
{% elif interface.mode == 'normalize' %}
{% for vni_id, vlan_id in interface.vni_vlans_mapping.iteritems() %}
flexible-vlan-tagging;
unit {{ vlan_id }} {
vlan-id {{ vlan_id }};
}
{% endfor %}
{% endif %}
{% if interface.lacp_mode is defined %}
aggregated-ether-options {
lacp {
{{ interface.lacp_mode }};
system-id {{ interface.lacp_system_id }};
}
}
{% endif %}
}
{% endfor %}
}
{% for interface in access.interfaces %}
{% if interface.mode == 'normalize' %}
{% for vni_id, vlan_id in interface.vni_vlans_mapping.iteritems() %}
vlans {
bd{{ vni_id }} {
interface {{ interface.name }}.{{ vlan_id }}
}
}
{% endfor %}
{% endif %}
{% endfor %}
{% endif %}